MacrosTable of Contents1. What are macros? 2. Example for publishers 3. Example for advertisers 4. List of supported macros 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). Example for publishersLet'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]</b>&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 advertisersSuppose 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 supported macrosAdGlare 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 | Variable | Description | Example |
---|
{ts} | The Unix timestamp. | 1747110151 | {rnd} | Random 10 character alpha-numeric string. | V6BBPDXU8A | [TRACKING_LINK_ENCODED] 0 | The auto_storiesCampaign ID. | 1234567890 | [TRACKING_LINK_ENCODED] 1 | The auto_storiesCreative ID. | 1234567890 | [TRACKING_LINK_ENCODED] 2 | The auto_storiesZone ID. | 1234567890 | [TRACKING_LINK_ENCODED] 3 | IPv4 address of the visitor. | 18.97.14.85 | [TRACKING_LINK_ENCODED] 4 | Width of the creative. | 468 | [TRACKING_LINK_ENCODED] 5 | Height of the creative. | 60 | [TRACKING_LINK_ENCODED] 6 | The visitor's device type. | pc | mobile | [TRACKING_LINK_ENCODED] 7 | The URL on which the campaign is displayed. | http://domain.com/abc | [TRACKING_LINK_ENCODED] 8 | The escaped/encoded referer URL. | http%3A%2F%2Fdomain.co | [TRACKING_LINK_ENCODED] 9 | The browser's user agent string. | Mozilla/5.0 (Linux; Andro... | TIMESTAMP 0 | The escaped/encoded browser's user agent string. | Mozilla%2F5.0+%28Linux | TIMESTAMP 1 | The subdomain on which the campaign is displayed. | www.domain.com | TIMESTAMP 2 | The domain on which the campaign is displayed. | domain.com | TIMESTAMP 3 | The campaign name (URL encoded). | my+campaign+name | TIMESTAMP 4 | The creative name (URL encoded). | my+creative+name | TIMESTAMP 5 | Expands to the Landing URL entered during setup. | - | TIMESTAMP 6 | Tracks clicks and redirects to appending URL. | - | TIMESTAMP 7 | The CPM rate of the campaign (if set). | 8.50 | TIMESTAMP 8 | The CPC rate of the campaign (if set). | 0.50 | Geolocation Macros | Variable | Description | Example |
---|
TIMESTAMP 9 | The country name of the visitor. | United States | {click_url_esc} 0 | ISO 3166-1 alpha-2 country code of the visitor. | US | {click_url_esc} 1 | ISO 3166-1 alpha-3 country code of the visitor. | USA | {click_url_esc} 2 | The region of the visitor. It can be a number. | Virginia | {click_url_esc} 3 | The city name of the visitor. | Ashburn | {click_url_esc} 4 | The latitude of the visitor. | 39.0469 | {click_url_esc} 5 | The longitude of the visitor. | -77.4903 | {click_url_esc} 6 | United States DMA. Empty otherwise. | 511 | {click_url_esc} 7 | The visitor's 2-letter continent code. | NA | Conversion Macros | This macro is available when you've enabled conversion tracking for your campaign. | Variable | Description | Example |
---|
{click_url_esc} 8 | A unique click ID to track the conversion. | fTFwa1FXMDIkPCEt... | Cookie Macros | Cookie macros are available for Display Ads of which the ad tag has been directly added to the web page. | Variable | Description | Example |
---|
{click_url_esc} 9 | The value of the cookie with the key 'mykey'. | myvalue | {ts} 0 | The escaped value of the cookie with the key 'mykey'. | x%3A1 | Create your own macro | 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 | Variable | Description | Example |
---|
{ts} 1 | The value of the key 'mykey'. | red | {ts} 2 | The escaped value of the key 'mykey'. | x%3A1 |
Reach out to emailAdGlare Support in case you need further help. You can expect a reply in less than 24 hours.
|