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

What is gws_rd=cr in Google URL

Last night, As i was about to switch off my computer, I noticed something strange on my browser. It was a weird URL in the address bar of Google chrome. I thought its a bug and reloaded the homepage (google.com) but again the weird part appeared at the end of google.com. It was like appended at the end.

Normally when we visit Google search, we find ourselves at www.google.com but i was being redirected to www.google.co.in/?gws_rd=cr. At first, i thought that my PC is infected. But it wasn’t.

I tried switching to different browsers and incognito mode as well, but the result was the same. I was still being redirected to a strange URL. Check the Image below.

gws_rd=cr screenshot google chrome

Wikipedia Sources

Then i searched for gws_rd=cr in Google search, but i couldn’t find any accurate answer. I spent an hour on this and finally figured out that GWS meant Google Web Server. Source Wikipedia. But the rest part rd=cr was still a mystery to me.

Google Product Forum Sources

Today i decided to search for gws_rd=cr in Google Product Forums and guess what? I found a thread about it. Here’s the link. That thread lead me to another website called stack exchange where some people have answered to this question.

Remote Desktop?

Some people assumed rd stood for remote desktop. That could be the worst threat to your computer. Since remote desktop means someone can remotely view or control your computer. But don’t worry that was just a wild assumption.

Mystery Solved

Finally the mystery is solved, rd=cr simply meant redirect and country. gws (google web server)_rd(redirect)=cr(country). So basically, when you visit google.com they are redirecting you to a google web server according to your country. That’s what it can be. Check the image source given below.

gws rd cr source stack exchange

However if you have any more sources or info, leave it in the comments. This will help to add more updates to this post.

Increase AdSense CPC By Displaying Ads Only To Organic Traffic

Are you getting low CPC in your Google AdSense account? Then maybe i can help you with it. One way to increase AdSense CPC is by displaying AdSense advertisements only to organic traffic. Organic traffic means the traffic driven to your websites by natural search engine results. Now you might wonder, How is this going to help increase AdSense CPC, right? But trust me, it works. I’ll explain.

First lets clear the basics, CPC means Cost Per Click. This is the revenue which you earn when a visitor clicks on the advertisement. In simple language, if you receive 10 clicks with $0.04 CPC then your estimated earnings would be 10 x $0.04 which equals to 0.40 dollars.

The next thing which you should know about is CTR and Pageviews. Pageview is counted when a user views a page displaying Google Ad. While CTR is equal to number of clicks divided by pageviews (clicks / pageviews).

Direct Visitors

If you display ads to direct traffic then AdSense pageviews increases but unique clicks decreases and chances of invalid clicks increases. And because of these invalid clicks, CPC decreases.

Organic Traffic

If you display ads only to search engine visitors then AdSense pageviews decreases but unique clicks increases and chances of invalid clicks are almost next to zero.


You get unique and valid clicks by displaying ads only to search engine visitors. Also useless pageviews are reduced. By useless pageviews, i mean those pageviews which displays an AdSense Ad but receives no clicks. By reduction in useless pageviews, Page CTR increases.

And with this increase in chances of valid clicks and page CTR, your CPC rises. Note that, this doesn’t happen in one day. It will take at least a week to experience a change in AdSense CPC.

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

How To Increase Security Of Google Account

I have previously written about storing all your personal pictures and videos on Google plus and thus save hard disk space. After reading this post people have been asking me ‘what about security?‘ Also ‘what if our account gets hacked?‘ In this post I’ll be sharing some info on how to secure your Google account.

You can find all Google security settings on this page – Google Security Settings. This is one of the things which i love about Google because this enables users to manage all security settings on one single page.

You can completely secure your Google account by making use of these four options:

  1. Proper password
  2. Recovery options
  3. Notifications
  4. 2 step verification

Managing Passwords

The first step to secure your Google account is not just choosing the right password but also changing it on a regular basis. Also you must login to your account only from trusted devices and networks. Unknown devices might have keyloggers installed which will record your password while unknown networks might record the information you send over it.

Recovery Options

In recovery options you can add a phone number and alternate email address. The phone number and email address you provide to Google can be used to recover your account if your account gets hijacked or if you forget your password.


You can enable email and mobile notifications for your Google account. These notifications help you to stay one step ahead of account hijackers by notifying you of important changes to your account.

For example, if your password is changed or if any suspicious activity is detected then Google will notify you by email and by SMS. You can choose whether you want mobile notifications or not.

Two step verification

This is the most important and essential part of securing your Google account. The 2 step verification will ensure that your account is always protected.

This can be explained in four simple steps

  1. Sign in to your Google account by entering username and password as usual.
  2. A code will be sent to your mobile phone.
  3. You’ll be asked to enter the code which they sent to your phone.
  4. Once you enter this code, you’ll be logged in.

Trusted Devices for 2 step verification

When you’re logging in, you can choose not to ask for code again on that particular device. Which means if you login from your home computer you can choose not to be asked for code again, so the next time you login from the same computer you’ll be logged in without 2 step verification.

But if you use a different device then that particular device will go through two step verification at all times unless you choose to make it a trusted device.

Here’s what Google has to say about two step verification –

Why you should use 2 step verification

There’s another feature in addition to two step verification which is called as application specific passwords. I’ll talk about that in the next post.

How To Set Email Forwarding In Linux Hosting

In the previous post I have written about creating an email account on Linux web hosting. But creating an email account with your web hosting is just not enough.

Because their interface is not so user friendly. So what you can do is forward all emails to your preferred email service like gmail.

To do so, you’ll need to create an email account with your Linux web hosting account. If you have already got one then you are good to go.

Sign in to your web mail account. The interface might be different for you but surely you can find settings option somewhere on the page.

Web Mail Settings - Linux Web Hosting

Click on the settings option. This will take you to a new page which will contain several different tabs. Find a tab which reads ‘forwarding‘. Click on it.

Webmail Email Forwarding - Linux Web Hosting

On this page you’ll find a input field to enter the email addresses. You can add as many email addresses as you want (one on each line). And hit update/save button.

That’s it, now every mail which you receive will be forwarded to the addresses which you added in forwarding list.

How To Create Email Accounts In Linux Hosting

Some of my friends have been asking me about how to create an email account on their Linux web-hosting.  It’s very simple, just the new interface may seem complicated since many people are not used to it.

So lets see how to create an email account using cPanel in Linux web-hosting. First of all log into your account and open cPanel. Some hosts like BigRock use ‘Manage Web-Hosting‘ option as a link to cPanel. So if you have any trouble accessing cPanel, contact your web hosting support.

Once you are logged in to cPanel, you can find mail options as shown below –

Mail Options cPanel - Linux

Now click on Email Accounts option and you will get a page as shown below –

Email Accounts cPanel - Linux Web Hosting

Fill in the details like Desired Email address, Password (at least 5 characters long), Mailbox Quota (i’d suggest to keep as default – 2048 MB). And then hit Create Account button.

Where To Find Inbox ?

You can find inbox for the newly created mail address at webmail.yourdomain.com. For example, if i create an email address as someone@codefap.com then i can find my inbox at webmail.codefap.com.

When you visit webmail.yourdomain.com (replace yourdomain), you’ll have to enter mail address and password to access your inbox.

Additional Info

But its not convenient to visit this site every time to check our mail. Also the mail interface is far too simple. I prefer Gmail over this webmail service at any time. So what we can do is Forward every E-mail to our preferred mail service like Gmail. I’ll be talking about that in the next post.

Shutdown Computer When Torrent Download Is Completed

Most of us download torrents overnight by keeping the computer ON. This can result in waste of power since the computer remains ON even when the downloads are completed.

One solution is to schedule auto shutdown by determining the time required to download a particular torrent. But this isn’t a very efficient method because the torrent may take a little longer than the auto shutdown timer and thus the download can remain incomplete.

So instead of scheduling auto shutdown you can tell the uTorrent application to initiate shutdown when all downloads are completed.


Shutdown when downloads complete
uTorrent – Shutdown when downloads complete
  1. Set a Torrent for download.
  2. Now click on Options > Auto Shutdown > Shutdown when Downloads Complete

Additional Info

In this case the computer will initiate shutdown if and only if the torrent is downloaded completely. But again this will keep the computer on if the torrent download fails which will result in waste of power.

So what I’d suggest is that it’s best to use both methods in combination. Set uTorrent to Auto Shutdown when downloads are completed. And in addition to this set your own Auto Shutdown timer by Estimating the time required to download the torrent.

For example, If a particular torrent takes 2 hours to download.

  1. I will set uTorrent to Auto Shutdown when downloads are completed.
  2. And also i will set Auto Shutdown timer of 2.5 hours duration.

This will ensure that even if torrent download fails, the computer will turn off. Thus saving power.