Clear search
Close search
Google apps
Main menu

Use iframe tags

Please note that this feature is only for publishers using Google Ad Manager tags. When you are using Google Publisher Tags (GPT), your ads will automatically load into iframes.

Instead of JavaScript, you can use iframe tagging, which is available upon request. With iframe tagging, you'll define ad units only in the FillSlot calls, not in the header of the page. Also, iframe tags will load independently of page content so your ads don't have to wait for your page to load before being displayed.

Using iframe tags may cause conflicts with rich media, AdSense, and page formatting. For assistance with iframe tags, please contact us.

Tagging with iframes enables you to use the same header tag on all of your pages. Additionally, any latency issues that you're experiencing should improve when using iframes, since the ads will be loading independently of the page content. DFP Small Business iframe tags do not require that your ad slots be defined in the header of the page, but the slots must be defined in the FillSlot calls.

Please be aware of the following limitations when using iframe tags:

  • Rich media expandable ads don't function properly with iframe tags, page formatting is disrupted if there is no ad to serve, and AdSense page view stats can get thrown off.

  • You may experience latency from third-party ads when utilizing the iframe tagging feature; this latency is independent of the coding within DFP.

  • Be aware that you cannot run both our default tags and iframe tags on the same page. However, you can have different tagging styles on different pages of your site.

  • It is recommended that you test the iframe tags on a few pages of your site to compare the performance against our default tags before you re-tag your entire site.

If you understand these limitations and are still interested in using iframe tags, let us know and we can enable this feature for you. Please note that the support team will be unable to help you implement iframe tagging or troubleshoot any issues you have due to the complexity and variability in implementation between publishers.

Preparing a page to serve ads in an iframe with DFP Small Business requires distinct blocks of JavaScript, described below. Do not combine JavaScript blocks, or your code may break.

Step HTML Description


Step 1 <script type='text/javascript' src=''>


Required: Load JavaScript files used by DFP Small Business.
Step 2 <script type='text/javascript'>


Required: Enable your page to display ads.
Step 3 <script language="JavaScript">
    GA_googleAddAttr("Gender", "Male");
    GA_googleAddAttr("AgeRange", "18To24");
    GA_googleAddAttr("InterestArea", "cars");


Optional: Set page-level attributes that influence ad selection. Arguments are case sensitive (example: 'male' isn't the same as 'Male').
Step 4 <script type='text/javascript'>
    GA_googleAddAdSensePageAttr("google_color_bg", "F0F0F0");
    GA_googleAddAdSenseSlotAttr("AdUnitName", "google_color_bg", "F0F0F0");


  • (Required) GA_googleUseIframeRending: Enable iframe rendering
  • (Optional) GA_googleAddAdSensePageAttr: For pages that serve AdSense ads, you may pass AdSense parameters to all ad units that appear on a page.
  • (Optional) GA_googleAddAdSenseSlotAttr: For Adunits that serve AdSense ads, you may pass AdSense parameters and values to a particular unit.


<h1>Title of your page</h1>


Step 5 <!-- test -->
<script type='text/javascript'>
    GA_googleFillSlotWithSize("ca-pub1", "Ad_Unit_Name", 300, 250);


Required (once per ad unit): Display ads.
  <Normal content of your web page.>




Was this article helpful?
How can we improve it?