Set up line items in Google Ad Manager

Media Owners
Last Updated: February 12, 2026

Before you begin: The following instructions only apply to Media Owners that manage their own integrations. If Index manages your integrations, you can skip this task.

  1. Sign in to Google Ad Manager.
  2. 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 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 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.
        ExampleValue

        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 to be associated with it. Make sure that the Serve into a SafeFrame checkbox is deselected and that the size in the creative 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>
      					

      Here's 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>