Search Images Maps Play YouTube News Gmail Drive More »
Sign in

Trafficking and creatives

Make a test page for mobile line items

Before deploying new mobile ad tags to a live website, you should place them on a test page to check their functionality. Creating a test page before deployment allows you to isolate the tags and confirm that they've been implemented properly, independent of the other elements of your website.

The following instructions outline the process of creating a JavaScript ad tag for high-end devices for a mobile test page. Since the actual steps may vary depending on your particular environment, please talk to your web developer or Information Technology (I.T.) team if you have questions about how to complete this process at your organization.

To create a mobile test page:

  1. Open a plain-text editor (such as Notepad or TextWrangler) and place the following code in a blank file:

    <html>
    <head>


    </head>
    <body>


    </body>
    </html>
  2. On the Inventory tab in DFP, select Mobile as your target platform, then select the ad unit you'd like to test.

  3. Click Generate tags.

  4. You'll see two parts of the ad tag listed under Header and Document body.

  5. Copy and paste the Header portion into your text editor in between the <head> and </head> tags.

  6. Copy and paste the Document body portion into your text editor in between the <body> and </body> tags.

  7. If applicable, manually add custom targeting key-values to the ad tag.

  8. The contents of your text editor should now resemble the following example:

    <html>
    <head>
    <script type='text/javascript' src='http://www.googletagservices.com/tag/js/gpt_mobile.js'>
    </script>
    <script type='text/javascript'>
    googletag.cmd.push(function() { googletag.defineUnit('/1234567/ca-pub-1234567890/ad_unit_name', [300, 50], 'div-gpt-ad-1234567890-0').addService(googletag.pubads()); googletag.enableServices(); }); </script>

    </head>

    <body>
    <!-- ad_unit_name -->
    <div id='div-gpt-ad-1234567890-0'>
    <script type='text/javascript'>
    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1234567890-0')}); </script>

    </div>
    </body>
    </html>
  9. Save the code as an HTML file.

  10. Upload the HTML file to the web server that hosts your web content. This step is largely dependent on your web host configuration, so your web developer or I.T. team should be able to help you if you have questions about how to complete it. If you can't upload the page to a web server, you can save it locally.

  11. Visit the URL (or file location) for your test page and ensure that the ad tag functions properly. Please use the User Agent switcher in Firefox or the Developer Tools in Safari to simulate the mobile environment.