Google Ad Manager

[- ADROTATE PRO FEATURE -]

When you create an advert in Google Ad Manager and perhaps some types in Google Adsense as well you'll get 2 pieces of code. One of which is supposed to go in your websites header, the other piece goes where the advert should show up. In AdRotate that's in an advert you create.

Adding the header code

First, add the header code in the AdRotate dashboard. You'll find the text field for that in the 'Header & ads.txt' tab in 'Manage Adverts'.

Simply paste the header code for your advert in the Google Ad Manager field:

And that's it for the header. Click save and continue.

Adding the body code

Next, create the actual advert in AdRotate. You'll do that the usual way from Manage Adverts by clicking New Advert.

In the create advert screen paste the body code in the AdCode field.

That'll look something like this:

To make the advert functional you need a schedule as well. And perhaps put the advert in a group. All other options are optional for this kind of set up.

For statistics you can use Impression tracking. Google of-course has its own tracking and click tracking won't work in AdRotate for these adverts.

Multiple adverts

If you have multiple adverts you'll get multiple header codes, you can combine those codes by taking 1 line from each extra header code and adding it to the one you're going to use.

For example you have this:

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> 
<script>
var gptadslots = []; 
var googletag = googletag || {cmd:[]};
googletag.cmd.push(function() {

//Adslot declaration
gptadslots.push(googletag.defineSlot('/123/Test', [[728,90]], 'div-gpt-ad-1234567-1') .addService(googletag.pubads())); 

googletag.enableServices(); 
}); 
</script>

And this code:

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> 
<script>
var gptadslots = []; 
var googletag = googletag || {cmd:[]};
googletag.cmd.push(function() { 

//Adslot declaration 
gptadslots.push(googletag.defineSlot('/456/Demo', [[728,90]], 'div-gpt-ad-7654321-1') .addService(googletag.pubads())); 

googletag.enableServices(); 
}); 
</script>

You'll notice that these 2 snippets are almost identical. And if you look in the second code you'll see that only the adslot definition is a little different.

gptadslots.push(googletag.defineSlot('/456/Demo', [[728,90]], 'div-gpt-ad-7654321-1') .addService(googletag.pubads()));

This means that you can copy that single line and add it to the first header code just below the one that's already there in the header code you're going to use. That way it'll look like this:

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var gptadslots = []; 
var googletag = googletag || {cmd:[]};
googletag.cmd.push(function() { 

//Adslot declaration 

gptadslots.push(googletag.defineSlot('/123/Test', [[728,90]], 'div-gpt-ad-1234567-1') .addService(googletag.pubads())); 
gptadslots.push(googletag.defineSlot('/456/Demo', [[728,90]], 'div-gpt-ad-7654321-1') .addService(googletag.pubads())); 

googletag.enableServices(); 
}); 
</script>

Repeat these steps to add as many ad slots as you need.

The big benefit is that you do not load Google's remote code twice. This keeps your site fast and responsive. Loading the same code over and over is far from efficient.

Click save further down on the page and head over to Manage Adverts in AdRotate Pro.

Article Details

Article ID:
16
Rating :

Related articles

More plugins and services

AdRotate Pro Single License
AdRotate Professional
Banner manager

Get started with successful advertisement campaigns on your WordPress and Classicpress website within minutes. Use features like Geo Targeting, scheduling and post injection to start making that passive income!
AJdG Solutions Plugins
All my plugins
WordPress and Classicpress

Check out my handy plugins for WordPress and Classicpress. Also take a look at these extensions for WooCommerce and bbPress and run your webshop and forum more efficiently!