DoubleClick Macros – An Overview… Part 1
A macro is a short piece of code that serves as a shortcut for a message to the ad server. Macros will expand into a longer code string that the ad server can understand when they’re included in creative code or click through URLs. Ad server macros are useful for passing important information to your proprietary systems or third-party ad servers.
If the creative code is recognized as being from a certified
vendor, then it will automatically insert the proper macros. If DFP don't
recognize the third-party creative code, then we need to insert the macros
manually. We can manually insert the macro at the cursor's position in the
'Code snippet' field by clicking one of the insert macro buttons. Work with
respective third-party to determine where to insert the macro.
For clients upgrading from DART for Publishers: Creatives
that we trafficked in DART with DART macros will continue to serve as expected
after we upgrade. However, it is strongly recommend that we use the new syntax,
where available. This list represents all of the macros it supports in
DoubleClick for Publishers for Creatives which traffic after upgrading.
Cache-busting (random
number) macro
The cache-busting macro ensures that a fresh call is made to
the ad server every time the code is executed, so we’re accurately counting
impressions. Here is what the cache-busting macro looks like:
%%CACHEBUSTER%%
If we don't add the cache-busting macro to the creative
code, we’re more likely to see impression counting discrepancies between
DoubleClick for Publishers and a third-party ad server. Note that not all third
parties require the cachebuster macro.
Most creative vendors will offer a placeholder in their tag
to insert cachebuster macros.
For example, if your third-party creative code contains
something like this:
http://abc.3rd-party-serving.com/Targeting/adServer.php?ab=cd&e=12fg=click&ord=[RANDOM_NUMBER]
We will want to select [RANDOM_NUMBER] and click the Insert cachebuster macro button so that
it replaces the placeholder:
http://abc.3rd-party-serving.com/Targeting/adServer.php?ab=cd&e=12fg=click&
ord=%%CACHEBUSTER%%
Notes:
- %n will still work for creatives trafficked in DART, but we strongly recommend using the new syntax for all new creatives trafficked in the DFP upgrade.
- DART macros are case-sensitive. That is, %N is not a valid macro.
Click macro
A click macro allows us to track clicks on our third-party
creatives. There are two types of click-tracking macros:
- Un-escaped click macro: %%CLICK_URL_UNESC%%
- Double-escaped click macro: %%CLICK_URL_ESC_ESC%%
As a best practice, we recommend using an un-escaped click
macro when the creative hosted by another server is a standard image file
(GIF/JPG). We should use the double-escaped click macro for Flash (SWF)
creatives and for certain third parties. We can preview the ad and right-click
it to determine its file type. If we see a “Save Image As...” or “Save Picture
As...” option appear in the right-click menu, the creative is a standard image.
If we see an “About Adobe Flash Player...” option, the creative is a Flash
creative.
Notes:
- A small number of third parties use double escaping (%%CLICK_URL_ESC_ESC%%). For certified third parties, we’ll auto-insert this double-escaped click macro; however, if you’re unsure if you need a double-escaped macro, you should reach out to the third party for confirmation.
- %c will still work for creatives trafficked in DART, but we strongly recommend using the new syntax for all new creatives trafficked in the DFP upgrade.
- Warning: If you don't put a click-tracking macro in the correct place in your third-party code, you will most likely not track clicks on the creative. Talk to your third-party creative provider to learn where to put the click macro.
Tips:
Do not enter the click macro as the source of an image or
iframe. Doing so results in a click being recorded every time the image or
iframe renders, which is not legitimate and is filtered out as an invalid
click.
Click-through URL
macro
This macro can be helpful if we are traffic a custom
creative and we want the click-through URL that you set in the creative
trafficking screen to override the click-through URL built into the custom
creative code.
There are three URL macros you can use:
- %%DEST_URL%%
- %%DEST_URL_ESC%%
- %%DEST_URL_ESC_ESC%%
Normally the amount of escaping (whether we include ESC
once, twice, or not at all) depends on the third-party click-tracking company.
Some third-party click-tracking companies require the URL to be escaped, while others
do not.
The level of escaping required by a third-party
click-tracking company is normally specified in the tag with the click= string
in the third-party ad tag or custom creative code in DFP:
- click= escape it once (%%DEST_URL_ESC%%)
- click1= escape it once (%%DEST_URL_ESC%%)
- click0= don't escape it (%%DEST_URL%%)
- click2= escape it twice (%%DEST_URL_ESC_ESC%%).
Notes:
%u will still work for creatives trafficked in DART, but
strongly recommend using the new syntax for all new creatives trafficked in the
DFP upgrade.
Expand macro
This macro is most commonly used to track line items with
your backend reporting system. %e is used in combination with match tables,
which provide a relationship between the ID number in the database and the ID
number in DoubleClick for Publishers.
This can be useful for troubleshooting;
for example, a trafficker only has to look at the ad server response in order
to see the line item ID or creative ID that served to an ad tag.
We can insert the %e macro at the end of the ad's click
through URL in its creative assignment (for example:
http://www.firstautomobile.com/?%ecid!; inserts the creative ID for the line
item).
The different expand macros available are:
- %eaid! -- expands with line item ID
- %ecid! -- expands with the creative ID
- %eenv! -- expands with the environment (tag type) indicator. For example, 'i' if iframe, 'j' if JavaScript, etc.
- %esid! -- expands with the first-level ad unit ID serving the line item
- %epid! -- expands with the second-level ad unit ID serving the line item
- %eadv! -- expands with the advertiser ID of the line item being served
- %ebuy! -- expands with the order ID of the line item being served
The %e macros can be separated from one another in the click
through URL with any character that is safe for use in DFP click through URLs:
http://www.site.com/?%eaid!;%ecid!
Could become: http://www.site.com/?1234567;4265598
Notes:
The %e macro cannot be used by DFA clients running click-commands
on DFP sites. The advertiser_id or page_id values, for instance, will populate
with the DFP values instead of the intended DFA values.
This article will
continue to Part 2
DoubleClick Macros – An Overview… Part 1
Reviewed by Journey Of Digital Media
on
1/06/2014
Rating:
No comments
Post a Comment