Creative Services Toolkit

Documentation

DFP ClickMacro Documentation

Get help with implementing the DFP ClickMacro, and troubleshooting

Usage

The DFP Click Macro allows the DFP ad-server to track any external clicks from a creative. This allows us to get total impression and total click metrics directly from the ad-server itself.

  • Above is the HTML that should be inserted into the creative. The script tag creates a variable which functions as a placeholder for the DFP clickMacro code.

  • This is how you would use the ClickMacro variable inside a JS file. The definition for the variable should remain in the HTML code as stated above.
  • In any JS event that causes the page to change URL, simply add clickMacro + in front of the URL.

FAQ

  • Why does the clickMacro variable definition have to be inside the HTML?
    The DFP ad-server can only analyze the HTML code that it is given, which is the HTML code you paste inside Mockingbird. Therefore, if the ClickMacro is defined inside a JS file, the ad-server would miss it and the click tracking would not work.
  • Why is the value of the clickMacro empty?
    The default value of clickMacro is empty because Mockingbird is only a simulation of the DFP ad-server, and does not have all the advanced functions the real ad-server has. As a result, the value of the clickMacro must be empty in Mockingbird previews. Otherwise, when launching click URLs inside Mockingbird an error would occur and the URL would break.
  • What is the actual value of the clickMacro when ad-served?
    When the creative is served by the DFP ad_server, the value of clickMacro will be "%%CLICK_URL_UNESC%%". This value allows DFP to track the click when the page URL changes.
  • Do I add the clickMacro inside HTML anchor href
    When the creative is served by the DFP ad_server, the value of clickMacro will be "%%CLICK_URL_UNESC%%". This value allows DFP to track the click when the page URL changes.