Mobile Sentience has no apps in the Marketplace at this time.
Simple Two Affiliate Ad Rotation
The Situation
You’ve installed the Advertwhirl ad management plugin for WordPress, You’ve taken a quick look at Campaigns, allocations and rules still feel a little daunted. All you want to do is rotate ads between adsense and a local banner you have setup for one of your products. You’re not quite sure you want to be messing with rules and regular expressions and that other mumbo jumbo.
The Solution
Advertwhirl is quite flexible and lets you manage your advertising campaigns as simply or complexly as you require. If you just want to rotate between a few different ad sources Advertwhirl will help you do that with out the need for any complex configuration.
The Nuts and Bolts
The steps are pretty simple configure Advertwhirl to connect to your Adsense account, add a local ad source for the banner, create an ad campaign with a single allocation that has two ad source(an Adsense Ad Unit and your banner) and no rules. Thats it and this tutorial will walk you through it step by step in less just a couple minutes, unless you are one of those people that tweets everything you do or take a break to become Mayor of this tutorial.
Configure Adsense
Configuring Adsense is super easy. Your Adsense username and your Adsense password are all you need. Lets do it!
- Go to your WordPress blogs admin page
- In the admin “Settings” menu go to the Advertwhirl entry

- Go to the Advertwhirl Settings tab

- Go to the “Adsense Settings” panel right below “General Settings” and fill in your username and password for Adsense and hit Update.
- For security reasons your Adsense password will not be displayed and the field will remain blank if you come back to the settings page in the future. Don’t worry it’s still there.
- You can leave the other settings alone for now, they won’t effect anything you are doing in this tutorial.
That is it. You can now access your Adsense ads directly in Advertwhirl, as well as your Adsense Statistics.
Add the Banner
Adding your own banner is just as easy as setting Advertwhirl up to use Ad Sense.
- Go to the “Local Ads” tab next to the “Settings” tab on the left.
- Click on the “Ad Source” Button

- Fill in a name for your banner, this is what will appear in the dropdown list when you go to add it to your Allocation later.
- Fill in any notes to yourself in the Description field.
- Change the type from Ad Type from “URL” to “Inline Code”
- Paste the html for your banner into the Inline Code textarea
- Click “Add Source” to save your changes

The code I use in the the image consists of two parts, you can use to get you started if html is not your thing-diggity.
The first bit is only appropriate if you have Google Analytics setup for your site. If so you can paste your GA code in place of mine or you could modify mine. I am using Asynchronous Tracking. If you don’t have Google Analytics setup for your site or you don’t want to track the banner you can go ahead and skip this part and go onto the next bit.
If you use the Asynchronous Tracking code below you need to replace UA-XXXXX-X with your web property id. You can find it by logging into your Google Analytics Account, the web property id for each of your web profiles is listed to the right of the profiles name.
You will also need to replace “.YOURDOMAIN.COM” with the domain for your web profile. The stuff to the left of the “www”, don’t forget the first “.”!
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', '.YOURDOMAIN.COM']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
The second bit of code in my local ad is for the banner itself. Again, if you have your own html you wish to use go ahead. This is just here for those needing a hand getting started.
The following code will display a banner image and open a link when the visitor clicks the image.
Use this one if you want the link to open in the same window/tab as the one where the image is displayed. This will take the visitor away from the post where the ad is displayed.
<a href="LINK_WHERE_YOU_WANT_BANNER_TO_GO"><img src="LINK_WHERE_THE_BANNER_IMAGE_LIVES" alt="" /></a>
Use this one if you want the link to open in a new window or tab and leave the visitor on the post where the ad is displayed.
<a href="LINK_WHERE_YOU_WANT_BANNER_TO_GO" target="_blank"><img src="LINK_WHERE_THE_BANNER_IMAGE_LIVES" alt="" /></a>
Which either one you choose to use there are two parts that need to be changed. The instructions are exactly the same for both.
- Change “LINK_WHERE_YOU_WANT_BANNER_TO_GO” to the URL for the web page you wish to open when the banner is clicked. In the example image I the banner for Advertwhirl open the plugin page for Advertwhirl (“http://wordpress.org/extend/plugins/advertwhirl/”)
- Change “LINK_WHERE_THE_BANNER_IMAGE_LIVES” to the location of the banner image on your website, or whatever site it is located on. In the example image the banner is located on the Mobile Sentience website(“http://www.mobilesentience.com/banners/advertwhirl-take-charge-468×60.png”)
Don’t forget to leave the quotes.
That’s it. Time to create the campaign.
Create the Ad Campaign
Adding your own banner is just as easy as setting Advertwhirl up to use Ad Sense.
- Go to the “Campaigns” tab next to the “Local Ads” tab on the left.
- Click on the “Ad Campaign” Button
- Give the Campaign a name. This is how you will identify which Campaign you wish to use to fill an Ad Slot.The name shouldn’t have any spaces or special characters.
- Put any notes which will help you remember what the purpose of this Campaign is in the Description field
- There is already an Allocation created for you and all you will be needing is the one.
- Fill in a Description for the Allocation if you want. It’s just a way for you to keep track of what is what in complex configurations. For this simple one it won’t really be helpful and you can leave it blank if you want.
- Select the Adsense Ad unit that you wish to use
- Click “Add Advertisement Source”
- Select your banner ad.
- Set your weights. By default the weights are both 1, meaning every other Ad Slot will be filled either with an Adsense ad or your banner. In the example photo I set a weight of 3 for the Adsense ad and 1 for the banner ad. So 3 Ad Slots would be filled from the Adsense Ad Sourcce then 1 from the local banner Ad Source. Another way to look at it is with a 1-1 weight 50% of the Ad Slots are filled from each source and with a 3-1 75% are filled with the Adsense Ad Source and 25% with the local banner Ad Source.
- Click “Save Campaign” and you are done
Displaying Your Ads
Everything is configured and done, but I suppose you’re interested in using what you setup.
You have a few options
If you just want to get going with as little hassle as possible you can put a shortcode in your posts where ever you want ads from your new Campaign to appear. The shortcode is listed below, you will need to change YOUR_CAMPAIGN to the name you gave the Campaign in step 3 of creating the campaign.
[advertwhirl campaign=YOUR_CAMPAIGN]
If you don’t want to display the ads in your posts but would rather put them in your sidebar you can use the Advertwhirl widget. Just add it to a sidebar or anywhere else in your theme where widgets are enabled and select the campaign you which it to display ads from.
Or, if you are adventurous you can read the more advanced tutorial “Automatic Insertion of Advertisements in WordPress Posts” on how to modify your theme template files to automatically insert your ads from your new Campaign in your posts.
Download Advertwhirl
References
Mobile Sentience Advertwhirl page
Advertwhirl in the WordPress gallery
Tutorial with instructions for installing Advertwhirl Plugin
Automatic Insertion of Advertisements in WordPress Posts
Campaigns, Allocations and Rules oh my!




Sweet contribution, cool site layout, stick to the good work
Pingback: Sharing Ad Slots With a Guest Blogger | Mobile Sentience