Display Ads Only To Search Engine Visitors On Blogger Blog

I have previously written about displaying ads only to search engine traffic by using ad injection plugin for WordPress. But many people have asked me, if this is possible for blogger or not? The answer is yes, its possible.

In WordPress its as easy as clicking few buttons to setup all this ‘Display ads to search engine visitor’ stuff. But in blogger, you don’t have plugins, neither you can use php code. So the only way you can set up this ‘Ads to organic traffic’ thing is by using JavaScript.

In this post, I’ll show you how to display ads only to search engine visitors on your Blogger blog using some JavaScript. For this you’ll need to edit the blogger template.

There are two parts of code which you’ll need –

  1. Code to detect search engine visitor and set up ad units (Main Code)
  2. Code to Display Ad Units

Main Code

The code given above will help you to detect a search engine visitor to your Blog. Also at the end of the code you can find a function called as adunit1.

Copy the code given above into a notepad file. And make appropriate changes to the adunit1 function at the end of the code. You’ll have to replace the xxxx’s with the appropriate numbers from your Adsense code and you’ll have to change any other details (such as ad width and height if you’re not using a large rectangle).

Where To Add ‘Main Code’ ?

  1. Go to Blogger Dashboard > Template > Edit HTML
  2. Find <title><data:blog.pageTitle/></title>
  3. And just below it copy paste the Main Code
  4. Save Template

Check the screenshot given below. The main code (which is highlighted) is directly below <title><data:blog.pageTitle/></title>. This is how it should look like when you add the code to your Blogger template.

Adsense Main Code Blogger

Code to Display Ad

This is the code you’ll need to display the adunit1 which you added in main code. So basically all ad unit codes go inside the main code in the form of a JavaScript function. And wherever you need to display that particular ad unit, you’ll just add a JavaScript function call, which will help to display that ad unit.

Where to Add ‘Code To Display Ad’ ?

You can add this code in your template itself or you can even use it inside a Blogger Gadget. To use it inside Blogger Gadget follow the steps given below –

  1. Go to Blogger Dashboard > Layout
  2. Click on Add a Gadget button depending on where you would like to display the Ad.
  3. Now choose HTML/JavaScript from Gadgets list.
  4. Simple insert the code to display ad in content box
  5. Save the Gadget.

Check if it works

Find your website by using Google Search and visit your site from the search results. If you have followed everything properly then you must see your Ad when you visit the site from a search engine. Good luck.

If you have any problems, feel free to comment below. I’ll try to help.

Adding Multiple Ad Units

You can add multiple ad units by duplicating the adunit1 function in the main code and naming the new function as adunit2. Then you can call the new function by adunit2 function call in a new Blogger Gadget.

Note: Adding more than 3 ad units on single page is against Google AdSense Policies, so don’t do that.

Posts based on Organic Traffic –

  1. Increase AdSense CPC By Displaying Ads Only To Organic Traffic
  2. Using Ad Injection To Show Ads Only To Search Engine Visitors (WordPress)
  3. Display Ads Only To Search Engine Visitors On Blogger Blog

5 Replies to “Display Ads Only To Search Engine Visitors On Blogger Blog”

Comments are closed.