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 will not function properly with iframe tags, page formatting will be disrupted if there is no ad to be served and AdSense page view stats can get thrown off.
You may experience latency from third-party ads when utilising 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 retag 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 that 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 |
|---|---|---|
<html> |
||
| Step 1 | <script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'> |
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"> |
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'> |
|
</head>
<body> |
||
| Step 5 | <!-- test --> |
Required (once per ad unit): Display ads. |
<Normal content of your web page.>
|
