Link Search Menu Expand Document

PDF

Iframe Ad Tags

Publishers

Last updated on August 18, 2020


An <iframe\> ad tag represents an inline frame within your webpage allowing you to position ads on the window without impacting the rest of the page layout.


on this page


How Iframe Ad Tags Work

When a user browses to a webpage where you have implemented an OpenX iframe ad tag:

  1. The browser invokes an ad request for the ad unit referenced in the URL for the src attribute of the iframe tag.

  2. OpenX receives the request, performs the ad selection, and returns an HTML document with the embedded ad content.

  3. The browser renders the ad in the appropriate ad space.

  4. Iframe ad tags employ a client-side counting mechanism: they log an impression after the ad is rendered by the browser.


Benefits

Iframe ad tags have the following benefits:

  • Auto-refresh via ad request parameters.

  • Parallel execution, which minimizes page-load times.

  • You can hide source page information from downstream ad servers, such as the page and referring URLs.

  • Content styles are not influenced by the parent page CSS, so the ad in the iframe does not have to match the style of the rest of the page.


Limitations

Limitations associated with iframe tags include:

  • Each iframe tag is a standalone request for a single ad unit. They do not support ad unit group or multi-ad unit requests. To fulfill multiple ad units on the same webpage, you can implement an iframe tag for each ad unit you want to serve.

  • Multiple ad units on a page using iframe tags cannot communicate with each other.

  • Iframe tags are not compatible with most contextual-analysis networks.

  • To display ads that expand outside the dimensions of an iframe window, you must implement an iframe-buster.


Structure

An iframe ad tag contains HTML tags and various parameters.

Sample iframe Ad Tag

<iframe id='a62ae7d3' name='a62ae7d3'
src='http://delivery_server_domain/w/1.0/afr?auid=
8635&cb=INSERT_RANDOM_NUMBER_HERE&rd=5&rm=3"
frameborder='0' scrolling='no' width='728'
height='90'>

<a href='http://delivery_server_domain/w/1.0/rc?cs=
acd22faf&cb=INSERT_RANDOM_NUMBER_HERE"
target='_blank'>
<img src='http://delivery_server_domain/w/1.0
/ai?uid=8635&cs=acd22faf&cb=INSERT_RANDOM_NUMBER_HERE"
border='0' alt='' /></a></iframe>

Ad request URL

The ad request URL defines the iframe element, references the ad unit ID, and includes various ad request parameters.

<iframe id='a62ae7d3' name='a62ae7d3'
src='http://delivery_server_domain/w/1.0/afr?auid=8635&cb=INSERT_RANDOM_NUMBER_HERE&rd=5&rm=3'
frameborder='0' scrolling='no' width='728'
height='90'>
ParameterDescription
httpThe protocol. If your ad space uses SSL/TLS, specify https instead.
delivery_server_domainIndicates the hostname of your OpenX delivery server.
/wIndicates the web delivery medium.
/1.0Indicates version 1.0 of the OpenX iframe tag protocol.
/afrIndicates the request to serve an ad through an iframe ad tag.
.Separates the ad request from the ad tag parameters.
auidIndicates the unique ad unit ID.
&Separates each additional ad request parameter.
cbSpecifies a cachebusting setting, which requires you to replace the INSERT_RANDOM_NUMBER_HERE value with a random number to invoke a new ad request rather than serving an ad from the cache.
rdEnables auto-refresh for the ad tag.
rmIndicates the maximum number of refreshes.

Custom variables

You can also include custom variables in your iframe ad tags. For example, the URL for an iframe tag with custom variables for the user’s gender, age, and keywords might look like the following:

http://d.example.com/w/1.0/afr?
auid=1234&cs=xyz&c.gender=m&c.age=40&c.keyword=coupons

Implementating an Iframe Ad Tag

  1. Generate your iframe ad tag via the OpenX UI.

  2. Copy the iframe ad tag.

  3. Paste the ad tag in the website source code between the HTML body tags where you want the ad to display.

  4. Replace the value of the cb parameter with a random number (preferably a dynamically auto-generated number from your CMS) for cachebusting purposes.

Sample iframe ad tag implementation

<html>
<head></head>

<body>

Some content here. Ad goes here.

<iframe id='a62ae7d3' name='a62ae7d3'
src='http://delivery_server_domain/w/1.0/afr?auid=
8635&cb=INSERT_RANDOM_NUMBER_HERE&rd=5&rm=3"
frameborder='0' scrolling='no' width='728'
height='90'>

<a href='http://delivery_server_domain/w/1.0/rc?cs=
acd22faf&cb=INSERT_RANDOM_NUMBER_HERE"
target='_blank'>
<img
src='http://delivery_server_domain/w/1.0/ai?auid=8635&cs=
acd22faf&cb=INSERT_RANDOM_NUMBER_HERE"
border='0' alt='' /></a></iframe>

Some other content here.

</body>
</html>
NOTE

Replace the value of the cb parameter with a random number (preferably a dynamically auto-generated number from your CMS) for cachebusting purposes.