Structure of amp-ad tags

From Documentation
Jump to navigation Jump to search

As Javascript cannot be executed in AMP pages, it is not possible to use the ad controller. This means that the publisher has to integrate the ad positions and the corresponding ad labels. For this purpose, iq digital supplies the templates for all ad positions to be integrated via e-mail.

amp-ad tag example

Here is an example of an AMP ad tag for an iqadtile4 on the fictitious "Rheinischer Kurier" website:

<!-- iqadtile4 -->
<amp-ad width="320" height="320"
    type="doubleclick"
    data-slot="/183/rheinischer_kurier_amp/level2/level3/artikel"
    rtc-config='{
        "vendors": {
            "yieldlab": {"ADSLOT_ID": "123456789"},
            "aps": {"PUB_ID": "1234","PARAMS":{"amp":"1"}},
            "criteo": {"ZONE_ID": "123456789", "LINE_ITEM_RANGES": "0..20:0.01;20..60:0.05;60..420:1.00","PUBLISHER_SUB_ID":"rheinischer_kurier_amp"},
            "prebidappnexus": {"PLACEMENT_ID": "123456789"}
        }, "timeoutMillis": 999}'
    json='{"targeting":{"kw":["nospa","enozqi","digtransform","rheinischer_kurier_amp","iqadtile4","level2","level3"],"tile":["4"],"doc":["artikel"],"iqadtype":["amp"]}}'
    data-multi-size="320x53,320x80,320x106,320x160,320x50,300x50,300x75,300x100,300x150,300x250"
    data-multi-size-validation="false"
    data-loading-strategy="1.25"
    data-block-on-consent>
</amp-ad>
width and height
The parameters width and height define the main creative size of the ad position.
data-slot
This is where the corresponding ad unit of the AMP page is entered. The details on level2 and level3 need to be supplemented by the sections or sub-sections if these are present. If there are no sub-sections, then level3 is omitted. Important: always avoid a double slash //; moreover, all special characters – with the exception of the underscore "_" must be removed or replaced with the underscore "_". An example of an AMP article in the “Politics” section would look like this:
data-slot="/183/rheinischer_kurier_amp/politik/artikel"
rtc-Config
This is where the header bidding providers are listed. Important: There are corresponding IDs for each provider that must be entered there. They must be taken from the AMP ad tags sent by e-mail. Depending on the provider, an ID is chosen for the entire page or separate IDs for each position.
json
This is where the keyword targeting of the ad position can be found. The entry for kw comprises general keywords of the position and the publisher. Here, the sections or sub-sections should be listed in place of level2 and level3 if present on the page. Further keywords of the kind used on the corresponding MEW page should also be added here. tile is used to define the number of the ad position; it is the same as in the designation iqadtileX, where X stands for the number.

In the above example, in other words, the number 4 must be entered.

data-multi-size
This is where additional creative sizes are defined for the ad position. These must always be smaller than the main size. The details differ depending on the ad position.
data-loading-strategy
This parameter controls the loading behaviour and the impression tracking of an ad. In this case, an ad is only loaded and counted 1.25 screen sizes in advance.
data-block-on-consent
This parameter links the ad position with the integrated CMP of the page. The ad position may only load if the end user has previously consented.

The ad tags from the e-mail must be copied to the correct place in the article page. The specs for level2 and level3 must then be replaced according to the page.


Test insertions

For testing purposes, it is possible to add the keyword iqadtest in json targeting for the key kw. This results in the display of orange test ads in the positions. Important: this keyword must always be removed again before going live! The following is an example for the json targeting line of a political article page:

json='{"targeting":{"kw":["nospa","digtransform","enozqi","rheinischer_kurier_amp","iqadtile4","politik"],"tile":["4"],"doc":["artikel"],"iqadtype":["amp"]}}'

or for testing:

json='{"targeting":{"kw":["nospa","digtransform","enozqi","rheinischer_kurier_amp","iqadtile4","politik","iqadtest"],"tile":["4"],"doc":["artikel"],"iqadtype":["amp"]}}'

Currently, we have always integrated at least 4 positions: iqadtile1 with a maximum size of 320x160px and iqadtile3, 4 and 8 and all other positions with a maximum size of 320x320px.

It is unfortunately not always easy or possible to resize an ad position with AMP. To allow the container to adapt to the actual advertising, the position may not be in the visible area. Even then, it can only reduce its size but cannot extend beyond the maximum size. If a container does not resize itself, the advertising would be centrally displayed in the container and white areas would occur in the case of smaller advertising. Our sizes are therefore a compromise based on these conditions under which the advertising can be displayed in an AMP page.