Rich Media developer's guide

DoubleClick Studio macro exits

Objective

You want to insert DoubleClick information/macros into your exit URL.

Solution

There are two ways to add DoubleClick information, like an ad ID, to an ad:

  • Use DoubleClick macros in the destination URL in the DoubleClick Studio Web UI
  • Use the Studio API to get DoubleClick information, building a query string or full URL in your ActionScript. Then use the enabler.exitQueryString(id:String, queryString:String) or the enabler.exit(id:String, url:String) method from the HtmlEnabler class of the DoubleClick Studio API in AS2 or AS3
When you use dynamic exit URLs, the landing page may redirect to a different URL. This is controlled by the landing page server, not DoubleClick.

Set-up

Before you add DoubleClick macros to exits, see the chart below for information on available macros and their equivalent Studio API calls:

Macros supported by DoubleClick Studio

Macro
DoubleClick Studio API method
DoubleClick ad server parameter
%eadv! enabler.getParameter("adv"); advertiser ID
%eaid! enabler.getDartAdId(); ad ID
%ebuy! enabler.getParameter(“buy”); campaign ID
%ecid! enabler.getDartCreativeId(); creative ID
%epid! enabler.getDartPageId(); placement ID
%erid! enabler.getDartRenderingId(); rendering ID
%esid! enabler.getDartSiteId(); site ID
%n No API available random number
%p No API available pattern match
%s enabler.getDartSiteName(); site name

How-to

  • Use DoubleClick macros in the destination URL in the Studio Web UI.

    Just paste the landing page URL that contains the DoubleClick macro data into the Destination URL field in the Events > Exits tab.

    Sample third-party redirect URL
    Macros are highlighted red in this example.
    http://yourdomain.com/clk?aAgencyId=01&aSource=adsrv&aTrackDataExt=
    123456;%epid!
    ;%eaid!;%ecid!&migRandom=%n&aTrackFmtExt=client;io;ad;crtv&
    aUnencodedDest=http://yourdomain.com
  • Use DoubleClick parameters as an exit query string in Flash.

    If you want to add DoubleClick parameters to an exit URL, make sure there's a corresponding Studio API method for it. If there's no Studio API method, you can't pull the DoubleClick information into the exit URL.
    • exitQueryString method
      1. Append the Studio API methods that correspond to each of the DoubleClick parameters in the second parameter of the exitQueryString method. Here's a code sample:
        var adIdVar:int = enabler.getDartAdId();
        var siteIdVar:int = enabler.getDartSiteId();
        function onExitHandler(event:MouseEvent):void {
              enabler.exitQueryString("my exit", "adid=" + adIdVar + "&siteid=" + siteIdVar);
        }

        exitBtn.addEventListener(MouseEvent.CLICK, onExitHandler);
      2. Add the base URL in the destination URL field in the Events > Exits tab.

        For example, using http://yourdomain.com/ as the base URL, the resulting URL that the ad clicks out to might look like this when the ad is on a live tag:

        http://yourdomain.com/?adid=123456789&siteid=123456
         
    • exit method

      Add the entire exit URL with the corresponding DoubleClick parameters in the second parameter of the exit method. For example:
      var adIdVar:int = enabler.getDartAdId();
      var siteIdVar:int = enabler.getDartSiteId();
      function onExitHandler(event:MouseEvent):void {
         enabler.exit("my exit", "http://yourdomain.com/?adid=" + adIdVar + "&siteid=" + siteIdVar);
      }

      exitBtn.addEventListener(MouseEvent.CLICK, onExitHandler);
      The resulting URL that the ad clicks out to might look like this when the ad is on a live tag: http://yourdomain.com/?adid=123456789&siteid=123456

 

Android-style image of the author of this page

Sarah is a DoubleClick Studio expert and author of this help page. Help her improve this article by leaving feedback below.

Was this article helpful?