Display Ad Server
Native Ad Server
VAST Video Ad Server
content_pasteRelease Notes
error_outlineNetwork Status
Terms of Service
Security Policy
Privacy/GDPR
Productsarrow_drop_downFeaturesPricing
DocumentationAPI
menu
Ad Tags
auto_storiesMacros for Ad Serving
auto_storiesAMP HTML Ads
Best Practices
auto_storiesEvaluating 3P Ad Tags for Speed
Campaign Setup
auto_storiesFlight Dates, Quantity & Pacing
auto_storiesCampaign Tiers
Getting Started
auto_storiesGetting Started with AdGlare
auto_storiesAdGlare Glossary
Good To Know
auto_storiesRevive vs AdGlare
auto_storiesAdblock Detection Script
auto_storiesThe Importance of Async Ad Tags
auto_storiesAd Server Pricing
auto_storiesVideo Ad Server with VAST Support
License & Billing
auto_storiesCDN Bandwidth & Fees
auto_storiesDownload Invoice PDFs
auto_storiesCancel License
auto_storiesReplace Credit Card
auto_storiesUpgrade Plan
Native Ads
auto_storiesNative Ads API
Reports
auto_storiesConversion Tracking
auto_storiesMetrics & Dimensions
auto_storiesCustom Formulas
auto_storiesExporting Data
Targeting
auto_storiesFrequency Capping (GDPR)
auto_storiesKeyword Targeting
auto_storiesKey/Value Targeting
auto_storiesGeotargeting Locations
auto_storiesBrowser/OS/Device Targeting
Tutorials
auto_storiesWhite Labeled Ad Serving
auto_storiesBot Filtering for Ads
auto_storiesLazy-Loading Ads
auto_storiesKeeping Ads On The Screen
auto_storiesAdding a 3rd Party Tag
User-Interface
auto_storiesMove to different Folder

Macros for Ad Serving

menu_book Knowledge Base chevron_right Ad Tags
AdGlare Ad Server

AdGlare comes with some built-in macros that you can use in Third-Party tags or Landing URLs. These types of macros are commonly used for cache-busting.

They can also be used to pass on valuable information to the Landing Page of an ad. For example, the page the ad has been shown on, or ad server-specific identifiers like the zone ID, campaign ID, creative ID, etc.

Find below a list of all macros AdGlare supports.

Commonly Used Macros

VariableDescriptionExample
{ts}The Unix timestamp.
1664650442
{rnd}Random 10 character alpha-numeric string.
TE9BVUGD58
{zID}The Zone ID.
1234567890
{cID}The Campaign ID.
1234567890
{crID}The Creative ID.
1234567890
{pID}The Contact ID.
1234567890
{ip}IPv4 address of the visitor.
18.208.132.74
{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
{subdomain}The subdomain on which the campaign is displayed.
www.domain.com
{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
{landing_url}Expands to the Landing URL entered during setup.
-
{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.
-
{cpm}The CPM rate of the campaign (if set).
8.50
{cpc}The CPC rate of the campaign (if set).
0.50

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.
Virginia
{geo_city}The city name of the visitor.
Ashburn
{geo_latitude}The latitude of the visitor.
39.0469
{geo_longitude}The longitude of the visitor.
-77.4903
{geo_dma_code}United States DMA. Empty otherwise.
511
{geo_continent_code}The visitor's 2-letter continent code.
NA

Conversion Macros

VariableDescriptionExample
This macro is available when you've enabled conversion tracking for your campaign.
{agcid}A unique click ID to track the conversion.
fTFwa1FXMDIkPCEt...

Cookie Macros

VariableDescriptionExample
Cookie macros are available for Display 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
{ag_custom_esc_mykey}The escaped value of the key 'mykey'.
x%3A1

External Resources

Share This
Article!

emoji_peopleMore about AdGlare

Since 2013, AdGlare powers the ad serving stack of hundreds of brands and publishers worldwide. With ideas and suggestions coming from Publishers, AdOps and Marketeers like you, we're proud to offer one of the most up-to-date ad servers in the market. We adhere to IAB's LEAN Ads Program and Google's Coalition for Better Ads.

Are you a publisher or brand? Reach out to see how we can help you.