Revive AdServer (Formerly OpenX Source) Magic Macros

Share This

Magic Macros are your typical macro commands that you can place inside the HTML banner or the banner destination URL for an ad to insert various attributes into the generated ad code.

HTML Content Macros

Magic Macro Description
{clickurl} Substituted by the Revive AdServer (Formerly OpenX Source) click tracking URL for the delivered ad
example: http://…/delivery/ck.php?oaparams=2__bannerid=…
{timestamp} Substituted by a decimal string based on the current timestamp
example: 1185290310.72
{random} Substituted by a 10 character alpha-numeric random string value
example: b616f31e72
{logurl}* Substituted by an Revive AdServer (Formerly OpenX Source) impression logging URL
example: http://…/delivery/lg.php?bannerid=…
{logurl_enc}* Substituted by url-encoded  Revive AdServer (Formerly OpenX Source) impression logging URL
example: http%3A%2F%2F…%2Fdelivery%2Flg.php%3Fbannerid%3D…
{target} Substituted by the target value for the selected banner
example: _blank
{url_prefix} Substituted by the base delivery URI of the Revive AdServer (Formerly OpenX Source)
example: http://ads.example.com/www/delivery
{bannerid} Substituted by the ID of the selected banner
example: 123
{zoneid} Substituted by the ID of the selected zone
example: 456
{source} Substituted by the value of “source=” as passed into the ad-request from the site tags
example: source=cat123/cat456…
{pageurl} Substituted by the URL of the page the ad was requested on (url encoded)
example: http%3A%2F%2Flocalhost%2Fmagic_macros%2Ftest.html
{referer} Substituted by the referrer of the page the ad was requested on (url encoded)
example: http%3A%2F%2Flocalhost%2Fmagic_macros%2F
{width} Substituted by the width (in pixels) of the selected ad
example: 468
{height} Substituted by the height (in pixels) of the selected ad
example: 60
{clickurlparams} Substituted by the parameters which would be passed to the {clickurl}
example: 2__bannerid=X__zoneid=Y__source=cat123/cat456__cb=0d9139d879__maxdest=
{ANY_INPUT_VARIABLE} Substituted by any value present in the php $_REQUEST array ($_GET/$_POST/$_COOKIE)
example: {OAID} -> $_COOKIE[‘OAID’] = 1fd819ffc7267757ba681ff5daa3007e

If any of the magic macros are present in the HTML, but the value cannot be found, then the replaced value depends on the type of macro:

  • For core macros ending in id – The value zero is used
  • For other core macros – An empty string is used
  • For “ANY_INPUT_VARIABLE” macros – The macro string is left unchanged in the HTML

IMPORTANT: If either {logurl} or {logurl_enc} are detected in an HTML ad,  Revive AdServer (Formerly OpenX Source) will not log an impression, but will pass the logging URL on to a 3rd party and rely on them to call-back using the logurl provided.

URL Macros

The {clickurl} Macro

By inserting the {clickurl} macro into the banner HTML for an ad stored on a third party server,  Revive AdServer (Formerly OpenX Source) can track clicks on that ad.

 When the ad is clicked,  Revive AdServer (Formerly OpenX Source) substitutes the click tracking URL for the macro, for example: http://.../delivery/ck.php?oaparams=2__bannerid=.... The browser is redirected to this URL where  Revive AdServer (Formerly OpenX Source) counts the click and then forwards the browser to the ad URL.

{clickurlparams}

The {clickurlparams} are the parameters that are passed to the {clickurl} address for third party click tracking. These parameters are:

  • bannerid
  • zoneid
  • source
  • cb
  • maxdest

{pageurl}

The URL of the page that requested the ad (url-encoded), for example: http%3A%2F%2Flocalhost%2Fmagic_macros%2Ftest.html

{logurl}

To track impressions for third party ads, use the {logurl} macro. When the ad is displayed,  Revive AdServer (Formerly OpenX Source) substitutes the impression logging URL for the macro, for example http://.../delivery/lg.php?bannerid=.... The browser is redirected to this URL where  Revive AdServer (Formerly OpenX Source) logs the impression and then forwards the browser to the ad. As with the {clickurl} macro,  Revive AdServer (Formerly OpenX Source) appends various parameters for the ad to the URL and passes these to the impression logging page.

{logurl_enc}

The {logurl_enc} macro is similar to the {logurl} macro but the substituted URL is url-encoded, for examplehttp%3A%2F%2F...%2Fdelivery%2Flg.php%3Fbannerid%3D....

{url_prefix}

The URL to the base of the  Revive AdServer (Formerly OpenX Source) delivery server, for example http://ads.example.com/www/delivery


9 Responses to “Revive AdServer (Formerly OpenX Source) Magic Macros”

  1. […] If the HTML tag comes from an unlisted third party, you must perform a manual change to the ad code. The third party will supply a mechanism to track clicks which is, typically, a placeholder in the ad code for the click tracking URL. Replace this placeholder with the {clickurl} magic macro. […]

  2. […] same HTML Banner (banner code) but modified using OpenX Source / Revive Adserver Magic Macros (replaced by OpenX Source / Revive Adserver with values upon […]

  3. Great tutorial.
    I need help in passing user’s current latitude and longitude into api for location base advertising.
    I searched on tutorial.But not succeed .Pleae help me that how to achieve it with magic macros
    I tried to pass it in url as extra parameters.
    cb=24amp;lat=23.028217amp;lon=72.559236amp;user_lat=23.028217amp;user_lon=72.559236amp;user_latitude=23.028217amp;user_longitude=72.559236′

  4. fravelgue says:

    Hello, Sorry for a newbie question. I just started to play with revive.

    Do you know what are macros for clickid or unique transactionid and for publisherid? I have tried with {unique} and {publisher.id} and They doesn´t work.

    Thanks in advance,

    • Ilya Ber says:

      Only the ones listed are currently available. If you are looking for a unique transaction ID, have you tried the {OAID} ?

  5. Marcio says:

    Hi,
    I´d like to know if there is a way to get the ID of the current impression.

    Thanks,
    Marcio

  6. Alex says:

    Hi, is there an updated list of the current macros that can be used in revive adserver? It seems that some of these are not working anymore and potentially there are new ones?

    Best, Alex

  7. n11 says:

    Isn’t there a macro such as {pageurl}, but where you get only the domain (ie: example.com instead of example.com/page-1234/) ? Thanks

Leave a Reply

Recent Revive AdServer (Formerly OpenX Source) Expandable Banners

Revive AdServer (Formerly OpenX Source)  Expandable Banners The following example demonstrates a 600px by 150px banner served by Revive AdServer (Formerly OpenX Source)  and expanded to 600px by 300px on rollover. The flash creative can be either uploaded to creatives directory directly (FTP) or just as an another Revive AdServer (Formerly OpenX Source)  banner (preferred). When uploading the SWF creative, you do not need to replace any hardcoded URLs or indicate a destination URL – that would be done in the HTML banner setup. Essentially, we are just using it as a storage container for our creative, all impressions and clicks will be … read more

 Twitter  LinkedIn  Google+  Skype RSS

Get in Touch

  • r Phone:
    (416) 877 2844 / (647) 258 4847
  • h Email:
    company@blackriver.to
  • m Address:
    1454 Dundas St. East, Suite 124
    Mississauga, Ontario
    L4X1L4, Canada

Any Questions?

Email

Message