Comments (17)
DFP seems to have updated overnight. Does anyone have access to the documentation for this? I'm trying to patch it ASAP.
from dfp-events.
Hi Luke,
I tried to search for new docs - but couldn't find. Please give me the guidlines of what to search - I'll try to help.
from dfp-events.
I can't find them anywhere. message
isn't returning as a string, which is why search
isn't working. From what I can tell, that block of code needs to find the name of the DFP event, and then trigger the new logger and then return the initial event to the old logger. This means we need to figure out how to get a string for the DFP event happening from that function and whatever arguments are getting passed into it.
from dfp-events.
Also, is this even going to work anymore? gpt.js
is completely refactored, so does that mean this plugin will need to find new events to hook into?
from dfp-events.
message is now an object and has getMessageId() method, maybe we can use it ?
from dfp-events.
Yeah, getMessageId() replaces the string output. If you match up the logged output in googles console (using ?google_force_console) and then output the message ids with:
for (i in googletag.debug_log.G) {
console.log(googletag.debug_log.G[i].getMessage().getMessageId())
}
You'll see a very distinct pattern - so with regards to dfp-events, just need to change the match value to a number (id)
from dfp-events.
For example:
Google service JS loaded = 8
Associated ([\w]*) service with slot = 40
Completed rendering ad for slot = 6
from dfp-events.
How do you find the slot number?
from dfp-events.
Ok, so I modified addEvent to:
addEvent = function (name, id, match) {
events.push({
"name" :name,
"id" :id,
"match" :match
});
};
Events are now:
addEvent("gpt-google_js_loaded", 8, /Google service JS loaded/ig);
addEvent("gpt-gpt_fetch", 46, /Fetching GPT implementation/ig);
addEvent("gpt-gpt_fetched", 48, /GPT implementation fetched\./ig);
addEvent("gpt-page_load_complete", 1, /Page load complete/ig);
addEvent("gpt-queue_start", 31, /^Invoked queued function/ig);
addEvent("gpt-service_add_slot", 40, /Associated ([\w]*) service with slot ([\/\w]*)/ig);
addEvent("gpt-service_add_targeting", 0, /Setting targeting attribute ([\w]*) with value ([\w\W]*) for service ([\w]*)/ig);
addEvent("gpt-service_collapse_containers_enable", 78, /Enabling collapsing of containers when there is no ad content/ig);
addEvent("gpt-service_create", 35, /Created service: ([\w]*)/ig);
addEvent("gpt-service_single_request_mode_enable", 63, /Using single request mode to fetch ads/ig);
addEvent("gpt-slot_create", 2, /Created slot: ([\/\w]*)/ig);
addEvent("gpt-slot_add_targeting", 17, /Setting targeting attribute ([\w]*) with value ([\w\W]*) for slot ([\/\w]*)/ig);
addEvent("gpt-slot_fill", 50, /Calling fillslot/ig);
addEvent("gpt-slot_fetch", 3, /Fetching ad for slot ([\/\w]*)/ig);
addEvent("gpt-slot_receiving", 4, /Receiving ad for slot ([\/\w]*)/ig);
addEvent("gpt-slot_render_delay", 53, /Delaying rendering of ad slot ([\/\w]*) pending loading of the GPT implementation/ig);
addEvent("gpt-slot_rendering", 5, /^Rendering ad for slot ([\/\w]*)/ig);
addEvent("gpt-slot_rendered", 6, /Completed rendering ad for slot ([\/\w]*)/ig);
and the log method:
googletag.debug_log.log = function (level, message, service, slot, reference) {
var args = Array.prototype.slice.call(arguments),
e = 0;
if (message && typeof(message.getMessageId()) === 'number') {
for (e; e < events.length; e++) {
if (message.getMessageId() === events[e].id) {
googletag.trigger(events[e].name, args);
}
}
}
return old_log.apply(this,arguments);
};
from dfp-events.
Havent figured out value for
Setting targeting attribute ([\w]) with value ([\w\W]) for service ([\w]*)/ig
Yet
from dfp-events.
@MichaelFBA
You're going to need to open up your site in your browser like this...
http://www.mywebsite.com/?google_force_console
This will end up displaying the DFP console, and you can click on the tab that says "Page Request". You'll see all of these events being displayed and their timeline as if you were profiling them. If you open up your browser's developer tools and go to the console, you can then run the code that @bradleydeutsch posted above.
for (i in googletag.debug_log.G) {
console.log(googletag.debug_log.G[i].getMessage().getMessageId())
}
You should get a list of all the event IDs that have fired on your page, it will look like this.
If you need further information, try exploring googletag.debug_log
, which gave me the following response.
from dfp-events.
I think the best way to go about this (until there's proper documentation for the events DFP is firing), is to create an array for these events to fire. So gpt-slot_rendering
would become events[6]
.
from dfp-events.
@lukeshumard 8 is /Google service JS loaded/, 5 is /^Rendering ad for slot ([/\w]*)/
from dfp-events.
@lukeshumard do you have any idea what
/Setting targeting attribute ([\w]*) with value ([\w\W]*) for service ([\w]*)/ig
would map to? I don't have any services to setup :)
from dfp-events.
@bradleydeutsch thanks for spotting the typo. I'll start working on a patch for this now.
from dfp-events.
@bradleydeutsch yeah, i have no idea what to do about that as i've never used it. i imagine once the proper documentation is available, we can take a better approach. for now, any site running DFP and dfp-events.js is breaking, so anything that is slightly functional is better than right now.
from dfp-events.
Thank you, guys. For now everything seems to be working the same way as it was before the GPT refactoring. Can't find Setting targeting too - but I have .setTargeting() in the code, but google console doesn't show this event at all.
from dfp-events.
Related Issues (12)
- Licensing HOT 1
- Ads rendering response time similar to ?googfc HOT 4
- [REQUEST] publish to npm
- Event ImpressionViewable
- [DO NOT USE] Library will no longer work after Jan 21, 2019 HOT 1
- why are not all the tags firing up at gpt-slot_rendering HOT 1
- Is there a way to get name of the creative that was Loaded? HOT 4
- Excellent work! HOT 1
- Events not firing on Chrome and IE HOT 1
- Logging doesn't seem to work in <= IE8 HOT 2
- Incorrect logical operator in debug_log.log line 113 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dfp-events.