# Macros for templates and Advar templates

<p class="callout warning">When working with **advar templates** &amp; advar creatives, you need to **use the 2ND (and higher)** macros when adding macros related to **uploaded creative files**. Examples are &lt;ADHESE\_EXT\_2ND&gt;, &lt;ADHESE\_SWF\_SRC\_2ND&gt;  
</p>

<p class="callout warning">If you encounter invalid JSON responses (e.g., quotes in the campaign name), use the URI-encoded versions of the macros.</p>

<table id="bkmrk-parameter-uriencoded"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="align-left">**Macro**</th><th class="align-left">**URIENCODED**</th><th class="align-left">**Description**</th></tr><tr><td>&lt;ADHESE\_ADSPACE\_COMMENT&gt;</td><td>&lt;ADHESE\_ADSPACE\_COMMENT\_URIENCODED&gt;</td><td>The comment of the booking.</td></tr><tr><td>&lt;ADHESE\_ADSPACE\_END&gt;</td><td> </td><td>The end date of a booking.</td></tr><tr><td>&lt;ADHESE\_ADSPACE\_ID&gt;</td><td> </td><td>The unique ID of the booking.</td></tr><tr><td>&lt;ADHESE\_ADSPACE\_KEY&gt;</td><td>&lt;ADHESE\_ADSPACE\_KEY\_URIENCODED&gt;</td><td>The external reference or key of a booking.</td></tr><tr><td>&lt;ADHESE\_ADSPACE\_START&gt;</td><td> </td><td>The start date of a booking.</td></tr><tr><td>&lt;ADHESE\_ADVERTISER\_ID&gt;</td><td> </td><td>The ID of the selected Advertiser company</td></tr><tr><td>&lt;ADHESE\_ALT\_TEXT&gt;</td><td>&lt;ADHESE\_ALT\_TEXT\_URIENCODED&gt;</td><td>The content of the alt text field.</td></tr><tr><td>&lt;ADHESE\_BODY&gt;</td><td>&lt;ADHESE\_BODY\_URIENCODED&gt;</td><td>The body of the creative (if available).</td></tr><tr><td>&lt;ADHESE\_CLICK\_TAG&gt;</td><td>&lt;ADHESE\_CLICK\_TAG\_URIENCODED&gt;</td><td>The click tag of a creative (including URL).</td></tr><tr><td>&lt;ADHESE\_CONFIGURABLE\_TRACKER\_URL&gt;</td><td>&lt;ADHESE\_CONFIGURABLE\_TRACKER\_URL\_URIENCODED&gt;</td><td>If configured, the tracking URL that has been configured in the configuration.</td></tr><tr><td>&lt;ADHESE\_CREATIVE\_ID&gt;</td><td> </td><td>The unique ID of the link between the booking and the creative.</td></tr><tr><td>&lt;ADHESE\_CREATIVE\_NAME&gt;</td><td>&lt;ADHESE\_CREATIVE\_NAME\_URIENCODED&gt;</td><td>The name of the creative.</td></tr><tr><td>&lt;ADHESE\_DELIVERY\_MULTIPLES&gt;</td><td>&lt;ADHESE\_DELIVERY\_MULTIPLES\_URIENCODED&gt;</td><td>The delivery multiples value of the booking.</td></tr><tr><td>&lt;ADHESE\_DELIVERY\_MULTIPLES\_GROUP\_ID&gt;</td><td>&lt;ADHESE\_DELIVERY\_MULTIPLES\_GROUP\_ID\_URIENCODED&gt;</td><td>The group ID for the delivery multiples, if needed.</td></tr><tr><td>&lt;ADHESE\_DURATION&gt;, &lt;ADHESE\_DURATION\_2ND&gt;, &lt;ADHESE\_DURATION\_3RD&gt;, &lt;ADHESE\_DURATION\_4TH&gt;, &lt;ADHESE\_DURATION\_5TH&gt;, &lt;ADHESE\_DURATION\_6TH&gt;</td><td> </td><td>The duration of the uploaded video files in seconds.</td></tr><tr><td>&lt;ADHESE\_DURATION\_MS&gt;, &lt;ADHESE\_DURATION\_MS\_2ND&gt;, &lt;ADHESE\_DURATION\_MS\_3RD&gt;, &lt;ADHESE\_DURATION\_MS\_4TH&gt;, &lt;ADHESE\_DURATION\_MS\_5TH&gt;, &lt;ADHESE\_DURATION\_MS\_6TH&gt;</td><td>  
</td><td>The duration of the uploaded video files in milliseconds.</td></tr><tr><td>&lt;ADHESE\_EXT&gt;, &lt;ADHESE\_EXT\_2ND&gt;, &lt;ADHESE\_EXT\_3RD&gt;, &lt;ADHESE\_EXT\_4TH&gt;, &lt;ADHESE\_EXT\_5TH&gt;, &lt;ADHESE\_EXT\_6TH&gt;</td><td>&lt;ADHESE\_EXT\_URIENCODED&gt;, &lt;ADHESE\_EXT\_2ND\_URIENCODED&gt;, &lt;ADHESE\_EXT\_3RD\_URIENCODED&gt;, &lt;ADHESE\_EXT\_4TH\_URIENCODED&gt;, &lt;ADHESE\_EXT\_5TH\_URIENCODED&gt;, &lt;ADHESE\_EXT\_6TH\_URIENCODED&gt;</td><td>The file extension of each uploaded file.</td></tr><tr><td>&lt;ADHESE\_EXTRA\_FIELD\_1&gt;</td><td>&lt;ADHESE\_EXTRA\_FIELD\_1\_URIENCODED&gt;</td><td>The content of the extra field 1.</td></tr><tr><td>&lt;ADHESE\_EXTRA\_FIELD\_2&gt;</td><td>&lt;ADHESE\_EXTRA\_FIELD\_2\_URIENCODED&gt;</td><td>The content of the extra field 2.</td></tr><tr><td>&lt;ADHESE\_FORMAT&gt;</td><td>&lt;ADHESE\_FORMAT\_URIENCODED&gt;</td><td>The format of the booking.</td></tr><tr><td>&lt;ADHESE\_HEIGHT\_LARGE\_3RD&gt;, &lt;ADHESE\_WIDTH\_LARGE\_3RD&gt;</td><td> </td><td>The dimensions of the third file that is uploaded.</td></tr><tr><td>&lt;ADHESE\_HEIGHT\_LARGE\_4TH&gt;, &lt;ADHESE\_WIDTH\_LARGE\_4TH&gt;</td><td> </td><td>The dimensions of the fourth file that is uploaded.</td></tr><tr><td>&lt;ADHESE\_HEIGHT\_LARGE\_5TH&gt;, &lt;ADHESE\_WIDTH\_LARGE\_5TH&gt;</td><td> </td><td>The dimensions of the fifth file that is uploaded.</td></tr><tr><td>&lt;ADHESE\_HEIGHT\_LARGE\_6TH&gt;, &lt;ADHESE\_WIDTH\_LARGE\_6TH&gt;</td><td> </td><td>The dimensions of the sixth file that is uploaded.</td></tr><tr><td>&lt;ADHESE\_LIB\_ID&gt;</td><td> </td><td>The unique ID of a creative in Adhese. This ID can be used to make JavaScript functions unique.</td></tr><tr><td>&lt;ADHESE\_ORDER\_ID&gt;</td><td> </td><td> </td></tr><tr><td>&lt;ADHESE\_ORDER\_NAME&gt;</td><td>&lt;ADHESE\_ORDER\_NAME\_URIENCODED&gt;</td><td>The name of the campaign.</td></tr><tr><td>&lt;ADHESE\_ORDER\_PRIORITY&gt;</td><td>&lt;ADHESE\_ORDER\_PRIORITY\_URIENCODED&gt;</td><td> </td></tr><tr><td>&lt;ADHESE\_POOL\_PATH&gt;</td><td>&lt;ADHESE\_POOL\_PATH\_URIENCODED&gt;</td><td>The location of where the ad is located on the server.</td></tr><tr><td>&lt;ADHESE\_POSITION&gt;</td><td>&lt;ADHESE\_POSITION\_URIENCODED&gt;</td><td>The position of the booking.</td></tr><tr><td>&lt;ADHESE\_PRIORITY&gt;</td><td>&lt;ADHESE\_PRIORITY\_URIENCODED&gt;</td><td>The priority of the campaign.</td></tr><tr><td>&lt;ADHESE\_SHARE&gt;</td><td>&lt;ADHESE\_SHARE\_URIENCODED&gt;</td><td>Deprecated.</td></tr><tr><td>&lt;ADHESE\_SWF\_SRC&gt;, &lt;ADHESE\_SWF\_SRC\_2ND&gt;, &lt;ADHESE\_SWF\_SRC\_3RD&gt;, &lt;ADHESE\_SWF\_SRC\_4TH&gt;, &lt;ADHESE\_SWF\_SRC\_5TH&gt;, &lt;ADHESE\_SWF\_SRC\_6TH&gt;</td><td>&lt;ADHESE\_SWF\_SRC\_URIENCODED&gt;, &lt;ADHESE\_SWF\_SRC\_2ND\_URIENCODED&gt;, &lt;ADHESE\_SWF\_SRC\_3RD\_URIENCODED&gt;, &lt;ADHESE\_SWF\_SRC\_4TH\_URIENCODED&gt;, &lt;ADHESE\_SWF\_SRC\_5TH\_URIENCODED&gt;, &lt;ADHESE\_SWF\_SRC\_6TH\_URIENCODED&gt;</td><td>The target URLs of the uploaded files, will be empty in case not uploaded.</td></tr><tr><td>&lt;ADHESE\_TAG&gt;</td><td>&lt;ADHESE\_TAG\_URIENCODED&gt;</td><td>The complete HTML code of an ad: object/embed code in case of a .swf file, JavaScript in case of third-party code, or img link tags in case of a static image.</td></tr><tr><td>&lt;ADHESE\_TEMPLATE\_CODE&gt;</td><td>&lt;ADHESE\_TEMPLATE\_CODE\_URIENCODED&gt;</td><td>The code of the template for the position of the booking.</td></tr><tr><td>&lt;ADHESE\_TEMPLATE\_CODE\_EXPORT&gt;</td><td>&lt;ADHESE\_TEMPLATE\_CODE\_EXPORT\_URIENCODED&gt;</td><td>The export code of the template of the creative.</td></tr><tr><td>&lt;ADHESE\_TRACKING\_URL&gt;</td><td>&lt;ADHESE\_TRACKING\_URL\_URIENCODED&gt;</td><td>The URL for tracking 3rd party impressions.</td></tr><tr><td>&lt;ADHESE\_URL&gt;</td><td>&lt;ADHESE\_URL\_URIENCODED&gt;</td><td>The target URL or landing page of the ad, as determined by the user.</td></tr><tr><td>&lt;ADHESE\_IMPRESSION\_TRACKING\_URL&gt;</td><td>&lt;ADHESE\_IMPRESSION\_TRACKING\_URL\_URIENCODED&gt;</td><td>The URL to count trackable impressions</td></tr><tr><td>&lt;ADHESE\_VIEWABLE\_TRACKING\_URL&gt;</td><td>&lt;ADHESE\_VIEWABLE\_TRACKING\_URL\_URIENCODED&gt;</td><td>The URL to count viewable impressions.</td></tr><tr><td>&lt;ADHESE\_WIDTH&gt;, &lt;ADHESE\_HEIGHT&gt;</td><td> </td><td>The dimensions of the first uploaded file.</td></tr><tr><td>&lt;ADHESE\_WIDTH\_LARGE&gt;,&lt;ADHESE\_HEIGHT\_LARGE&gt;</td><td> </td><td>The dimensions of the second file that is uploaded.</td></tr></tbody></table>

### Macros in Advar fields

If you want to fill in a macro in a field of an Advar template during creative creation, i.e.   
`pool-demo.adhese.com?bg_sourceid=<ADHESE_LIB_ID>` to be filled in a Landing Page field, you need to allow the macro to be replaced within the Advar template itself.

For example:

```
{
            "default": "<ADHESE_LIB_ID>",
            "doc": "replacementtest",
            "label": "NA",
            "type": "singleLineText",
            "key": "<recu-open_ADHESE_LIB_ID>"
}
```

Where &lt;<span style="background-color: rgb(241, 196, 15);">recu-open\_</span>\[MACRO\]&gt; allows the macro to be replaced in the Advar field.

<p class="callout success">For the macro replacement to work, the account configuration needs to be changed. Please [contact Support](https://adhese.atlassian.net/servicedesk/customer/portals) when you want to make use of this feature.</p>