Set up line items in Google Ad Manager
Before you begin: The following instructions only apply to Publishers that manage their own integrations. If Index manages your integrations , you can skip this task.
- Sign in to Google Ad Manager.
- Create the necessary line items using the following recommendations. For details on how to create line items in Google Ad Manager, see Create a line item in the Google Ad Manager help.
- Inventory sizes: Enter the inventory sizes of the creatives you want the line item An object configured through the Google Ad Manager (GAM) UI that contains information about a creative and the criteria required for it to show, including cost, size, priority, audience, and geographic location. to use. The size should match the sizes used in the key-value.
- Type: Set the appropriate type for the line item. Line items that target APMID have typically a higher priority than other line items.
- Add targeting: Set the targeting to accept AMP Accelerated Mobile Pages (AMP). An open source HTML framework developed by Google. AMP is optimized for mobile web browsing and is intended to help webpages load faster. Index supported formats include standard banner, multi-size, multi-format, and fast fetch/AMPHTML ads. traffic as well as key-values corresponding to the respective line item.
- Ad Unit: Set to the target Ad Unit for which the corresponding line item should activate.
- Key-values: Set the appropriate key-value.
Example Value Example 1 Line item: IX AMP 300x250 $4.51
Key Targeting: AOM (AOM) is 300x250_451
Example 2 Line Item: IX AMP 320x50 $15.01
Key Targeting: APM (APM) is 320x50_1501
Example 3 Line Item: IX AMP 320x50 $15.01
Key Targeting: APMID (APMID) is 300x50_deal1
- Create creatives for each line item: Each line item requires a Third Party creative type A classification of ads based on behavior. Describes the properties of the advertisement creative. Available formats include: standard, expandable, overlay/voken, in-banner video, survey, audio, and video. to be associated with it.
Make sure that the Serve into a SafeFrame checkbox is deselected and that the size in the creative A digital ad made available in various creative types, defined by their size in pixels such as 300x250px. code matches the size of the line item and creative object.
Add the following script to the Code snippet area in Google Ad Manager.
<script> var request = new XMLHttpRequest(); // Note replace <width> and <height> with appropriate values request.open('GET', '%%PATTERN:asPath%%?unk2=%%PATTERN:<width>x<height>_unk2%%'); request.onload = function(e) { var node = document.createElement('script'); node.type = 'text/javascript'; node.innerHTML = request.response; var iframe = document.createElement('iframe'); iframe.appendChild(node); document.head.appendChild(iframe); } request.send(); </script>
The following is an example of a creative script:
<script> var request=new XMLHttpRequest(); request.open('GET','%%PATTERN:asPath%%?unk2=%%PATTERN:300x250_unk2%%'); request.onload=function(e){ var node=document.createElement('script'); node.type='text/javascript'; node.innerHTML=request.response; var iframe=document.createElement('iframe'); iframe.appendChild(node); document.head.appendChild(iframe); }; request.send(); </script>