In-page build guide

Add an exit

This article applies to Flash creatives. To learn how to add an exit to HTML5 creatives, see Add an HTML5 Exit.

A DoubleClick exit is a click-through area in an ad. With Rich Media, you can create multiple exits, so that your ad can direct a user to various webpages. An exit is similar to a clickTag in standard Flash ads, however Studio doesn't detect a clickTag as an exit. Make sure that you implement DoubleClick exits in your creative when you're setting destination URLs.

Multiple exits can serve as a customised tracking element in Rich Media creatives. For example, you can set up different exits to track how many users click through to a social media page versus an advertiser's homepage link or a call-to-action phrase.

Every Rich Media creative requires at least one exit, and for Studio to recognise these exits, you must code them using the DoubleClick API or add them using the Invisible Exit Button component .

How do I add an exit?

We recommend adding exits to the child file(s) that users interact with. With polite load, users see the parent file only briefly as the page loads, so it's best to add exits to the child file.

Adding a DoubleClick exit is a two-step process. First, define the exit name in Flash. Then, when you upload the creative in the DoubleClick Studio Web UI, add a destination URL to the exit that you defined in Flash. You can also change the URL in DFA / DCM or DFP.

You can add an exit to a creative in two ways:

Option 1: Use the Invisible Exit Button component
The Invisible Exit Button component lets you create an exit without using ActionScript. Only the exit name is required as you develop the Flash file.
  1. To use the Invisible Exit Button component, drag it onto the stage from the component library and add it to a new layer called Exit. Place the button over the content that you want clickable in the creative.
  2. Open the Component Inspector (Shift+F7). Complete the setup by entering the exit name ( in illustration). DoubleClick Studio detects the name at upload.

    Partila picture Flash component inspector. This is the Setup section for the DoubleClick Flash Invisible Exit component with the "Exit name" text field highlighted and labeled A.

    The name that you give the Exit in the Component Inspector will appear in Studio. You can rename this in the Studio Web UI or in DFA / DCM to change what shows up in the final report.

     
Watch a video about adding the Invisible Exit component (3:49)
Option 2: Use the API
If you've already included a clickTag in your Flash creative, you may be able to convert it to a DoubleClick exit using the API.

To add an exit:

Call the enabler.exit("exit name goes here"); method.

  • The name that you give your exit using this method will appear in Studio. You can modify it there or in DFA / DCM to affect what shows up in the final report.
  • As best practice, we recommend always using the Mouse.CLICK MouseEvent when calling an exit. This will help avoid any pop-up blocker browser issues.
  • To learn more about advanced exit features like dynamic URLs or query strings, see Append values to an exit URL.

Studio reminder

DoubleClick's QA team tests all exits that you add to a creative. To avoid common QA revisions:

  • Add exits to the topmost layers in your FLA, so that they aren't blocked by other elements in the creative. If a clickable item lives in a layer over an exit, that item will prevent your exit from working.
  • Test every exit that you add – when you run the creative in Flash and when you upload to the DoubleClick Studio Web UI.

Additional requirements with exits

There are times when firing an exit also means that other actions need to be taken in a creative. For example, when an exit is called from an expanded panel of an Expanding creative, the expected behaviour is that the expanded panel collapses. The notes below detail requirements for specific creatives:

Exits in Expanding creatives
If you're building an Expanding creative, make sure that you add a Flash command to collapse the creative when a user exits.

To collapse an Expanding creative on exit, add this code to the creative:

AS3 Code snippet

import com.google.ads.studio.events.StudioEvent;

var onExitHandler:Function = function(event:StudioEvent){
    Expanding.getInstance().collapse();
}

enabler.addEventListener(StudioEvent.EXIT, onExitHandler);
Exits in Floating creatives
If you're building a Floating creative, make sure that you add a Flash command to close the creative when a user exits. However, when these two actions happen simultaneously in Flash, sometimes the function closes the unit without clicking through to an exit. To avoid this issue, delay the call to the close function by a second.

To delay the closing of a Floating creative on exit, add this code to the creative:

AS3 code snippet

import com.google.ads.studio.events.StudioEvent;

var onExitHandler:Function = function(event:StudioEvent){
    setTimeout(closeAd, 1000);
}

var closeAd:Function = function(){
    enabler.close();
}

enabler.addEventListener(StudioEvent.EXIT, onExitHandler);
Exits in Video creatives
If your creative includes video, make sure that you add a Flash command to stop all videos when a user exits.

To stop all videos on exit, add this code to the creative:

AS3 code snippet

import com.google.ads.studio.events.StudioEvent;

var onExitHandler:Function = function (event:StudioEvent){
    enabler.stopAllVideos();
}

enabler.addEventListener(StudioEvent.EXIT, onExitHandler);
Watch a video about adding the Invisible Exit component (1:21)

Try it!

Add two exits to the child file for your creative.

  1. Add one by placing the Invisible Exit Button component over an area in your creative such as a call to action phrase, a logo or an icon. Name the exit "My Invisible Exit".
  2. Using the API, make an exit named "My API Exit" fire every time that the user clicks the background of your creative. You can do this by adding a background MovieClip to your creative and giving it an instance name of myExitBtn.

    AS3 code snippet

    myExitBtn.addEventListener(MouseEvent.CLICK, onClickExitHandler);
    function onClickExitHandler(event:MouseEvent){
    enabler.exit("My API Exit");
    }

Test your work

Run the creative in Flash. When you click the exits, the following trace should appear in the output panel:

Enabler: Exit triggered: My API Exit
Enabler: Exit triggered: My Invisible Exit