Rich Media API handbook

Use DART parameters in Flash

Objective

You want to create one Rich Media unit that runs on three sites, and you want the headline to change depending on which site the creative is running on.

Solution

Use DART parameters in your Flash creative to pull in data about how a creative is trafficked and what sites it appears on. You can use this data to change the content of your creative based on where the ad appears, how the trafficker set it up, and other conditions.

Here are the DART parameters that you can pull into Flash and their corresponding methods from the HtmlEnabler class of the DoubleClick Studio API in AS2 or AS3.

  • DFA site name: enabler.getDartSiteName();
  • DFA ad ID: enabler.getDartAdId();
  • DFA page ID: enabler.getDartPageId();
  • DFA site ID: enabler.getDartSiteId();
  • DFA rendering ID: enabler.getDartRenderingId();
  • DFA creative ID: enabler.getDartCreativeId();

For more on the HtmlEnabler, see Add the Enabler.

Setup

On the stage of your Flash creative, set up a dynamic text box with the instance name of header. This text field will be used to populate the correct headline depending on which site the ad is being viewed on. When you set up this dynamic text box, make sure you size it to accommodate all the possible headlines you want in your creative. Otherwise, your headline could be cut off. For more best practices with dynamic text, see Embed fonts for a dynamic text field.

Once you set up the conditional statements in your Flash file, the headline will change based on the site ID, as illustrated:

Image of 3 images of the same ad linked to 3 different contents: A Target, B Kmart, C Walmart
Key
blue letter A

Hello Target customers

green letter b

Hello Kmart customers

red letter c

Hello Walmart customers

How-to

You have to pull in the parameter that gives you information about what site your creative is running on. The two DART parameters that gives you this information are site ID and site name.

  1. Before you can build the Flash logic to change headlines, you need the site IDs for each site the creative will be running on. You can get this information from your DFA or DFP traffickers. In this example, the creative runs on three sites: walmart.com, target.com, and kmart.com.

    You receive these site IDs:
    • walmart.com site ID = 1122
    • target.com site ID = 2233
    • kmart.com site ID = 3344
       
  2. In your Flash creative, pull in the DFA site ID parameter using enabler.getDartSiteId(); and store the parameter information in a variable mySiteID:
    var mySiteID:Number = enabler.getDartSiteId();
  3. Set switch statements to show the proper headline based on the site that the ad is being viewed on. Use the site IDs that your DFA/DFP trafficker gave you.
    //create variables to hold the site ID values

    var walmartSiteD = 1122;
    var targetSiteID = 2233;
    var kmartSiteID = 3344;

    var mySiteID:Number = enabler.getDartSiteId();

    //create a switch for what happens on each site
    switch (mySiteID) {
         case walmartSiteD:
         header.text = "Hello Walmart Customers";
         break;

         case targetSiteID:
         header.text = "Hello Target Customers";
         break;

         case kmartSiteID:
         header.text = "Hello Kmart Customers";
         break;

         default :
         header.text = "Hello Customers";
         break;

    }