Iframe ad-tag vs. Script ad-tag: Online advertising tag type comparison
Differences between iframe tag and script tag:
- Script tag does not change the “referrer” property of your ad-tag: If your ad-tag is served from inside an iframe, the ad-network that serves the ad will see a referrer property different that your page url/domain. On the other hand if you use a script tag, then the referrer url remains the same as your page url and therefore your domain name. Some ad-networks that require that the ad being served from the same domain that they were created for, will therefore not work with iframe tags (therefore they will not serve ads). Most ad-networks however allow setting of a “site-alias” that allows you to set a different domain from which the ad may be served. Read more about the referrer property here.
- Script tag works better for ad-networks that do contextual analysis of the content of the page: if you use iframe tags, ad-networks will not be able to look outside of the iframe therefore they will not be able to do on-the-fly contextual analysis of the contents of the page, therefore they may serve irrelevant ads. Read more about contextual analysis here.
- Iframe tags are easier for inclusion inside a web-page, since you can save an ad-tag in a file, and load it as an iframe into your web page. This will also allow parallel load of the ad-tag iframe. For example if your web-page is:
<script type=”” …>
More questions? Drop me an email.
Update: For #3 "Script tag works better for ad-networks that do contextual analysis", Google AdSense does mention in their help section for Why aren't my ads relevant?, read on:
The AdSense code was placed within an IFRAME.
Our targeting technology is not optimized to serve ads within a separate IFRAME. If you placed the AdSense code in a separate IFRAME, your site may display less targeted ads or public service ads. For better results, please implement our ad code directly into the source of your webpage. Once you make these changes, relevant ads may not appear immediately. Until we are able to re-crawl your site, which may take up to 48 hours or more, your page may continue to display untargeted or public service ads.