Help Center Manage Your Account Ad Tag

How do I pass custom data and variables into the ad?

You can pass a custom value into the ad tag and our ad server will pass that same value along to the actual ad. This is useful when the ad displays dynamic content based on certain input. This feature can also be used for customized tracking or logging. For example, an ad displays today's interest rate for a mortgage loan that needs the actual interest rate supplied from outside.


  1. Append &custom=Your+Ad+Data to the ad tag. You can append the variable manually or enter it into Custom Parameters field when generating the ad tag
  2. Add the macro/placeholder {AS:Serving:Custom} (or {AS:Serving:CustomEncoded} for URL-encoded value) into the ad at the location where you want the actual data to be replaced.

Example - Dynamic Interest Rate

You want to display an ad that shows the best mortgage rate for a 30-year loan in a certain city.
  1. The ad tag has these pass-along parameters:
  2. The ad has these custom-data macros/placeholders inside its ad copy:
    Need a 30-year loan in {AS:Serving:Custom}? 
    Today's best rate is {AS:Serving:Custom1}% APR
  3. When this ad is served, our ad engine will replace the macro/placeholder {AS:Serving:Custom} with the actual value of Gilroy supplied from the ad tag. The result ad would display:
    Need a 30-year loan in Gilroy? 
    Today's best rate is 4.25% APR

Example - Cruise Line with Destination

In this example, you want to customize a travel cruise ad with the destination and the cruise line. The two custom parameters are provided to the ad tag and they will then be passed along to the ad itself, which could be a third-party URL, a landing page URL, a custom image URL, or some HTML code in a Rich-Media/HTML ad.
  1. Pass this into the ad request:
  2. Edit the ad's click URL with the pass-along/custom parameters:{AS:Serving:Custom}&company={AS:Serving:Custom1}
  3. The actual landing page for this ad would become:

Available Pass-Along Parameters

You can have up to 16 custom params:
Input ParameterPlaceholderURL-encoded Placeholder

VAST Video Ad

Pass-along parameters are also commonly used for video ads. A VAST-wrapper ad chain goes through multiple video ad servers. In order to select the right ad, a video ad server often needs data from the upstream ad server or from the publisher/website. To do that, those bits of information (video title, video description, keywords, etc.) are passed along via ad macros from one ad server to another ad server. For example, you can pass data from Roku to AdSpeed and then from AdSpeed to a third-party VAST wrapper. First, generate the VAST ad request for the zone and then add Roku macros to it:
Second, edit the ad in your account and add AdSpeed pass-along macros to the third-party VAST wrapper URL:

Integration - Passing value from page URL

You can pass values from the page URL's query string into the ad tag. The ad tag then in turn can continue to pass that same value to the ad's components or to other third-party ad tags. For example, this is your website URL and you want to pass ProductID into the ad serving tag:
You can do it via server-side or client-side code. Here is one example with client-side JavaScript:
var urlParams = new URLSearchParams(;
var myParam = urlParams.get('ProductID');
var extras = '';
if (myParam) {
	extras = '&custom='+encodeURIComponent(myParam);
} // fi

var adRequest = ''+extras;

Other Articles in Ad Tag

This section describes the ad tag (serving code) with basic and advanced settings. It includes common ad serving setup instructions and answers frequently asked questions when integrating the ad tag into your site, blog or app.

Cannot find an answer for your question? Ask our Customer Care team