Rich media developer's guide

How to use dynamic exit URLs


Use an exit URL from an external data source (such as Google Sheets, an XML feed, or Google Merchant Center) instead of entering it in Studio, Campaign Manager 360 or Google Ad Manager. 


The Enabler.exitOverride(id, url) method from the Studio HTML5 SDK overrides any exit URL entered in Studio, Campaign Manager 360, or Ad Manager.


Set up a string variable, exitURL, to hold the destination URL in your creative. The URL can be passed in dynamically through XML, sourced from a dynamic feed, or hard-coded.

Use an exit URL from a dynamic feed in Google Web Designer

  1. In the Dynamic panel, click + to add dynamic bindings.
  2. On the Bindings tab of the Dynamic Properties dialog, click Add Binding.
  3. For the element, select the ID of the Tap Area.
  4. For the element attribute, select Exit override URL.
  5. For the data schema object, select the object from your feed that represents the dynamic URL (e.g., Product.0.url).

Dynamic Exits in Studio - Google Web Designer

Use an exit URL from a dynamic feed in JavaScript

// Replace the dynamicContent value below with your own dynamic element value.
var exitURL = dynamicContent.Feed_1[0].ExitURL.Url;

function exitClickHandler() {
  Enabler.exitOverride("exit name goes here", exitURL);

exitButton.addEventListener('click', exitClickHandler, false);

Use a hard-coded exit URL in JavaScript

Only use a hard-coded exit URL when you know the URL will not need to be changed later. If you do need to change it, you'll have to update the creative code and resubmit the creative for trafficking. 

// productId is a value calculated elsewhere in the code, and
// is not shown in this example.
var exitURL = "" + productId;

function exitClickHandler() {
  Enabler.exitOverride("exit name goes here", exitURL);

exitButton.addEventListener('click', exitClickHandler, false);


Add values or parameters to dynamic exit URLs

Add third-party tracking to dynamic exit URLs with an additional method in your creative's JavaScript code to retrieve parameters set in Campaign Manager 360. Use the Enabler.getParameter method to get the landing page suffix value (stored in the exit_suffix macro) and append it to exit URLs from an associated dynamic feed.

Step 1: Add code to your creative

Using one of the options below, add code to your creative to combine the dynamic exit URL with the suffix from Campaign Manager 360.

Combine the dynamic exit URL and suffix in Google Web Designer

  1. Click the Tap Area where you want to apply the dynamic exit and suffix to.
  2. Add a new event (click the "+" button on the events panel).
  3. Select Tap Area > Touch/Click on the Event step.
  4. On the Action step, select Custom > Add custom action Add custom action
  5. Add a function name, then paste the following custom code in the text area. Replace the example exit URL with your own exit URL.
  6. Click OK.
// Replace '' with your own exit URL.
var exitURL = '';
var urlSuffix = Enabler.getParameter('exit_suffix'); 
var symbol = (exitURL.indexOf('?') > -1) ? '&': '?'; 
if (urlSuffix) { 
  while (urlSuffix.charAt(0) == '?' || urlSuffix.charAt(0) == '&') { 
    urlSuffix = urlSuffix.substring(1); 
  if (urlSuffix.indexOf('?') > -1) { 
    urlSuffix = urlSuffix.replace(/\?/g, '&'); 
exitURL = exitURL + symbol + urlSuffix;

Enabler.exitOverride('exit', exitURL);

Custom code to add a dynamic exit suffix
Combine the dynamic exit URL and suffix using JavaScript in any HTML editor

If you use an HTML editor other than Google Web Designer, use a JavaScript method like the one below to get the exit suffix from Campaign Manager 360. Before you can call this function, you need to load and initialize the Enabler.

function addSuffix(url, dcmParameter) { 
  var urlSuffix = Enabler.getParameter(dcmParameter); 
  var _url = ''; 

  if (url) { 
    var symbol = (url.indexOf('?') > -1) ? '&': '?'; 
    if(urlSuffix) { 
      while (urlSuffix.charAt(0) == '?' || urlSuffix.charAt(0) == '&') { 
        urlSuffix = urlSuffix.substring(1); 
      if (urlSuffix.indexOf('?') > -1) { 
        urlSuffix = urlSuffix.replace(/\?/g, '&'); 
    _url = url + symbol + urlSuffix; 
  return _url; 

// Example of how you would use this function:
exitUrl = addSuffix(exitUrl, 'exit_suffix'); 

Step 2: Add the URL parameters in Campaign Manager 360

After adding your creative to Campaign Manager 360, enter the query parameters that will be appended to your exit URL by adding a landing page suffix.

Choose where to add the suffix based on where it should be applied:

  • All landing pages in all campaigns: Add the suffix in advertiser properties.
  • All landing pages in a campaign: Add the suffix in campaign properties.
  • All creatives assigned to an ad: Add the suffix in ad properties.

Set the suffix at the highest level to apply it across more creatives. You can override the suffix by setting it at a more specific, lower level. For example, if you set a suffix in your advertiser properties, any suffixes set in the campaign or ad properties will override the advertiser-level suffix.

Add a landing page suffix

  1. Open the ad, campaign, or advertiser properties, and click Landing page URL suffix
  2. Enter your full suffix in the text box. 

    Suffixes can include multiple query parameters, but must be 128 characters or less. If the field is locked (), click the lock to unlock it. Locked fields inherit from the parent by default: a locked campaign field inherits from the advertiser settings; a locked ad field inherits from the campaign settings.
  3. Campaign Manager 360 identifies any key-value pairs in the suffix and allows you to edit them below the field as query parameters. You can choose macros or enter custom strings. To remove a key-value pair, click remove remove.

Landing page URL suffix settings in DCM

Landing page URL suffix settings and key-value editor in Campaign Manager 360.

Learn more about landing page suffixes in the Campaign Manager 360 Help Center

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue

Clear search
Close search
Google apps
Main menu
Search Help Center