Macros for Ad Serving

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}Unix timestamp1480970123
{rnd}Random 10 character alpha-numeric string7GQ7P767JW
{zID}Zone ID1234567890
{cID}Campaign ID1234567890
{crID}Creative ID1234567890
{ip}IPv4 address of the visitor.54.146.177.118
{width}Width of the creative468
{height}Height of the creative60
{ip}IPv4 address of the visitor.54.146.177.118
{country}ISO 3166-1 alpha-3 country code of the vistitor.USA
{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.com%2Fabc
{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%3B+Andro...
{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.-


Create your own Macros

You can also create your own macros and pass on their values via the invocation code. The custom parameter is written as: {ag_custom_yourkey}. The invocation code should then be appended with this key/value pair: &ag_custom_yourkey=yourvalue.

Example: Custom Macro

Say, you're using a third party code that should be generated dynamically. You wish to pass on a key/value pair like color=red.
1
You write your creative's third party code as follows:
<script type="text/javascript">
	(function() {
		var mycolor = '{ag_custom_color}';
		alert(mycolor);
	})();
</script>
2
You then call your zone's invocation code as follows:
http://yourname.engine.adglare.net/?123456789&ag_custom_color=red

Share this article




Permalink