Installing the code
One script tag and one slot tag, or the WordPress plugin. Banners then appear in your slots automatically.
Before you start
Your website must be approved, and you need at least one slot. Your site key and each slot id are shown on your site's page. Both are safe to put in public pages: they only say which site and slot a banner request is for, and requests from any other website are refused.
The snippet
Put the script tag once on every page that has a slot (before the closing </body> is a good place), and a slot tag wherever a banner should appear:
<!-- once per page -->
<script async src="https://rota.rotated.co.za/t.js" data-site="YOUR-SITE-KEY"></script>
<!-- where the banner should appear -->
<div class="rota-slot" data-slot="YOUR-SLOT-ID"></div>
Replace YOUR-SITE-KEY and YOUR-SLOT-ID with the values from your site page, which also shows the finished code for each slot ready to copy. You can use several slots on one page: add one slot tag for each, and the script tag still goes in once.
What the script does
- It finds every slot on the page and asks our server for a banner that fits the slot's size and your keyword rules.
- It shows the banner, with a small Ad via Rotated label under it, and links it through our server (so clicks can be counted). Links open in a new tab and are marked
rel="noopener sponsored nofollow". - It watches the banner and tells us once at least half of it has been on screen for one second, in a visible tab. That is a verified view.
- It sets no cookies and stores nothing in the visitor's browser.
- If no banner is available, or anything goes wrong, the slot stays empty and your page is not affected.
Slots on older installs
Slots can also be written with a size instead of a slot id, for example <div class="rota-slot" data-size="300x250"></div>. This still works, but slot ids are better: they identify exactly which slot a view came from.
The slot has to be on the page when it loads. Slots added later by scripts (for example in some single-page apps, or after a button click) are not picked up. Also, do not add your own refreshing: it is against the rules, and the server accepts a new banner request for the same slot from the same visitor at most once every 30 seconds anyway.
WordPress
The plugin does the work for you: it adds the script only on pages that contain a slot, and can print the ownership tag.
Install the plugin
- Download rotated-exchange.zip (version 0.2.0).
- In WordPress go to Plugins → Add New → Upload Plugin, choose the file, then Install Now and Activate.
- Go to Settings → Rotated Exchange. Paste your site key and press Save Changes.
Prove ownership with the plugin
On the same settings page there is a Verification code box. Paste the code from your site page there, save, then press Check now in your Rotated account. The plugin prints the required meta tag in your pages' head, so you do not need to edit your theme. You can clear the box once the site is verified.
Put a banner on a page
- Widget: Appearance → Widgets, add Rotated Exchange banner to a sidebar or footer, and enter the slot id.
- Shortcode, inside a post, page or text widget:
[rotated_slot slot="YOUR-SLOT-ID"]
The older form [rotated_slot size="300x250"] still works. A slot id that is not 12 letters and numbers (0 to 9 and a to f) is ignored and shows nothing, and a page without a slot loads nothing extra.
Page-caching plugins are fine: the banner is fetched by the visitor's browser, not stored in your cached page. If you use a plugin that delays or combines JavaScript, exclude rota.rotated.co.za from it.
If your site has a Content-Security-Policy
A strict policy can block the banner. Allow our host for scripts, images and connections:
script-src https://rota.rotated.co.za
img-src https://rota.rotated.co.za
connect-src https://rota.rotated.co.za
Clicks are ordinary links and need no extra permission.
Test that it works
- Open your page in a normal browser window (a private window is fine). Scripted or headless browsers are treated as bots and are shown nothing on purpose.
- You should see a banner with Ad via Rotated under it. If you do not, see Banner not showing.
- Scroll so the whole banner is visible for a couple of seconds. After a little while your site page and Results show the page load and the view.
Reloading many times will not show a banner every time: one visitor sees a given banner at most 3 times in 24 hours, and the same slot is asked for a new banner at most once every 30 seconds.
Removing it
Delete the script tag and the slot tags (or deactivate the plugin). Nothing else is left behind on your site.
