landscape
Display Ad Server
Serve ads in standard fixed-size ad units
api
Native Ad Server
Serve native ads on your web page or app
ondemand_video
Video Ad Server
Serve MP4 video ads as pre/mid/post-rolls
laptop_chromebook
For Publishers
Maximize revenue for direct deals.
campaign
For Advertisers
Optimize campaigns, real-time insights.
roofingProductsarrow_drop_downSolutionsarrow_drop_downPricing
User GuideAPISupport
login

Macros & Placeholders

What are macros?

Macros are placeholders inside URLs or ad tags that can be used to pass data from one system to another. They can be used for a variety of purposes in ad serving, like ad tracking, targeting audiences, or customizing ad content based on user signals (like device, country, etc).

play_circle
Click to play video

Example for publishers

Let's say that you received the following ad tag from an advertiser who's using Sizmek as their third-party ad server:
<script src="https://bs.serving-sys.com/Serving/adServer.bs?ncu=[TRACKING_LINK_ENCODED]&c=12&cn=display&pli=874782337&w=300&h=600&ord=[TIMESTAMP]&z=0&ucm=true"></script>
As you can see, this code has 2 placeholders: [TRACKING_LINK_ENCODED] and TIMESTAMP. Now you want to replace those placeholders with AdGlare's macros then will be expanded upon serving the ad. The relevant macros are {click_url_esc} and {ts} (see the list below).

After replacing the placeholders, the new ad tag will look like:

<script src="https://bs.serving-sys.com/Serving/adServer.bs?ncu={click_url_esc}&c=12&cn=display&pli=874782337&w=300&h=600&ord={ts}&z=0&ucm=true"></script>
Enter this modified tag as a creative in AdGlare, and you're good to go. If you're not sure which macro(s) to use, ask your advertiser for help.

Example for advertisers

Suppose that you're interested in knowing the user's device type after they click on your ad and are redirected to your landing page. To do so, you can add the device type macro to your landing URL. Here's an example:
https://www.advertiser.com/landing-page?device={device}
Add this URL, containing the macro, as a landing URL in your AdGlare creative. When served, the macro will expand dynamically to the device type of the user loading the ad. For example:
https://www.advertiser.com/landing-page?device=mobile

List of macros supported by AdGlare

AdGlare supports a wide range of macros that you can use inside third-party ad tags or landing page URLs. Find below a complete list of all macros supported:

Commonly Used Macros

VariableDescriptionExample
{ts}The Unix timestamp.
1713759075
{rnd}Random 10 character alpha-numeric string.
VB3H3X6MTZ
{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.
3.238.235.248
{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.
-
{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 macro

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