Skip to main content
This guide will use self closing tags (<script /> instead of <script></script>) for simplicity. Most JSX and other modern compilers will accept this syntax. However, if you are working in raw HTML, you should manually close the tags.

Add the Rev script

Learn how to add our script to your site.
Add the following script to the <head> of your HTML file.
page.html
  <script
    src="//js.rev.iq/your-domain.com"
  />
Add the following code
index.js
  const script = document.createElement('script');
  script.src = '//js.rev.iq/your-domain.com';
  document.head.appendChild(script);
You may also consider adding the defer attribute to the script tag to optimize initial page load speed.
If wanting to test with another monetization provider per client, you can use the following code to conditionally load the Rev script.
index.js
  const REV_RATE = 0.1; // 10% of users will see the Rev script
  const shouldUseRevIq = Math.random() < REV_RATE;
  const script = document.createElement('script');

  if (shouldUseRevIq) {
    script.src = '//js.rev.iq/your-domain.com';
  } else {
    // Load your other monetization provider
    // Set the attributes based on the other vendor's documentation
  }

  document.head.appendChild(script);

Development

Add the dev attribute to the script to use dev placements.
Add the following script to the <head> of your HTML file.
page.html
  <script
    src="//js.rev.iq/your-domain.com"
    dev
  />
Add the following code
index.js
  const script = document.createElement('script');
  script.src = '//js.rev.iq/your-domain.com';
  script.setAttribute("dev", "")
  document.head.appendChild(script);

Defining ad units

Add the data-ad attribute with the name of the placement to mark where you want ads to appear.
<div data-ad="right-rail-1" />
<div data-ad="right-rail-2" />
<div data-ad="right-rail-3" />

data-ad-size

You can customize the ad units by adding the data-size attribute with the desired size.
<div data-ad="right-rail-1" data-ad-size="300x250" />

data-kv-{key}

Additionally, you can add targeting tags to the ad units by adding the data-kv-{key} attribute.
<div 
  data-ad="right-rail-1" 
  data-kv-page="home" 
  data-kv-foo="bar"  
/>
I