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

Mobile

Getting started with mobile ad serving

Generate a mobile ad tag in DFP

The DFP Premium tag generator can automatically generate the HTML and JavaScript necessary to integrate one or more ad units on a page or application. Using the ad tag generator is optional, but generally easier and less error prone than manually rewriting code.

With the exception of Generating PHP, PERL or JSP tags for your server, as noted below, you don’t need to follow mobile-specific procedures to generate tags. Instead, use the Google Publisher Tag generator for both desktop and mobile devices; all Google Publisher Tags can be used for both mobile and desktop devices.

Generate PHP, Perl, or JSP tags for use on your server (if available in your network)

DFP Mobile

PHP, Perl and JSP tags enable you to request ads from your web server, allowing you to serve ads to devices that don't support JavaScript, such as phones with WAP browsers.

Notes:

  • Line item scheduling based on the user's time zone won't work with these tags, because the user’s time zone isn't available to the ad server. Scheduling based on the publisher's time zone will work normally.
  • Frequency capping also won't work with these tags, because the cookie isn't available to the ad server.

To generate PHP, Perl, or JSP tags, follow the steps above to generate tags. When you see the Generate tags window, follow these additional steps:

  1. In the Tag type drop-down menu, select All mobile devices.
  2. In the Tag language drop-down menu, select PHP, Perl, or JSP.

We recommend putting the Header code in a separate file and including it from the pages that use these tags, rather than copying this code into each page. Having only one copy of the header code makes it easier to update.

frequency capping won't work for server side requests because the cookie is not available to DFP