One of the following macros is required in code snippet: %%VIEW_URL_UNESC%%, %%VIEW_URL_ESC%%

181 Views Asked by At

I want to add One of the following macros %%VIEW_URL_UNESC%%, %%VIEW_URL_ESC%%. to the below tag:

`<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<div id="gpt-passback">
  <script>
    window.googletag = window.googletag || {cmd: []};
    googletag.cmd.push(function() {
    googletag.defineSlot('/27367402,20294362/ArabiaWeather_EN_Mobile', [1, 1], 'gpt-passback').addService(googletag.pubads()).setTargeting('lotame', ['%%PATTERN:lotame%%']);
    googletag.enableServices();
    googletag.pubads().set('page_url', '%%PATTERN:url%%');
    googletag.display('gpt-passback');
    });
  </script>
</div>`

where ?

Ive tried to add %%VIEW_URL_UNESC%%, %%VIEW_URL_ESC%% after the code, but im not sure if the implementation is correct

1

There are 1 best solutions below

0
rabsom On

These are 2 different things :

  • googletag : rely on the Google Publisher Tag library (GPT)
  • macros : rely on the creative template code in Google Ad Manager (GAM)

GPT library is made for generating GAM adrequests, which are calling GAM creatives (and its associated templates).

No need to insert adserver's macros in your ad integration. Macros are attached to creatives and generated every time a line item is called.

You have to insert macros in your template code (in GAM user interface) and add something like in your html part :

<img src="%%VIEW_URL_UNESC%%" />
<img src="%%VIEW_URL_ESC%%" />

Everything is detailed here and here.