Macros for Ad Serving

Last Updated:
AdGlare comes with some built-in macros that you can use in Third Party tags or Landing URLs. These macros are commonly known for its usage in cache-busting. They can also be used to pass on the page URL on which the ad is shown, as well as ad server variables like the zone ID, campaign ID, creative ID, etc.


Built-in Macros

VariableDescriptionExample
{ts}The Unix timestamp.
1534576103
{rnd}Random 10 character alpha-numeric string.
WTAEP2W5B
{zID}The Zone ID.
1234567890
{cID}The Campaign ID.
1234567890
{crID}The Creative ID.
1234567890
{ip}IPv4 address of the visitor.
54.156.85.167
{width}Width of the creative.
468
{height}Height of the creative.
60
{device}The visitor's device type.
pc | mobile
{referer}The URL on which the campaign is displayed.
http://domain.com/abc
{referer_esc}The escaped/encoded referer URL.
http%3A%2F%2Fdomain.co
{ua}The browser's user agent string.
Mozilla/5.0 (Linux; Andro...
{ua_esc}The escaped/encoded browser's user agent string.
Mozilla%2F5.0+%28Linux
{domain}The domain on which the campaign is displayed.
domain.com
{zone_name}The zone name (URL encoded).
my+zone+name
{campaign_name}The campaign name (URL encoded).
my+campaign+name
{creative_name}The creative name (URL encoded).
my+creative+name
{click_url}Tracks clicks and redirects to appending URL.
-
{click_url_esc}An escaped click URL macro.
-
{click_url_esc_esc}A double escaped click URL macro.
-


Geolocation Macros

VariableDescriptionExample
{geo_country}The country name of the visitor.
United States
{geo_country_iso2}ISO 3166-1 alpha-2 country code of the visitor.
US
{geo_country_iso3}ISO 3166-1 alpha-3 country code of the visitor.
USA
{geo_region}The region of the visitor. It can be a number.
VA
{geo_city}The city name of the visitor.
Ashburn
{geo_latitude}The latitude of the visitor.
39.0481
{geo_longitude}The longitude of the visitor.
-77.4728
{geo_dma_code}United States DMA. Empty otherwise.
511
{geo_continent_code}The visitor's 2-letter continent code.
NA


Cookie Macros

VariableDescriptionExample
Cookie macros are available for Inline Media Ads of which the ad tag has been directly added to the web page.
{cookie_mykey}The value of the cookie with the key 'mykey'.
myvalue
{cookie_esc_mykey}The escaped value of the cookie with the key 'mykey'.
x%3A1


Create your own Macros

VariableDescriptionExample
Custom macros are available when their keys have been passed to the ad tag URL. Example: http://yourname.engine.adglare.net/?123456789&ag_custom_mykey=red
{ag_custom_mykey}The value of the key 'mykey'.
red



Share This
Article!

Permalink for Bloggers
This article stays online on the following URL:

External Resources
Wikipedia: Cache Busting en.wikipedia.org
DFP Macros support.google.com

AdGlare
Ad Server
Ready in 30 seconds
Have a
look Inside

Time to switch ad servers?

Try AdGlare Ad Server. It will automatically detect macros from major ad tech vendors, saving you time.