How To Hide Adsense From Social Traffic
How To Hide Adsense From Social Traffic
Read on to find out How To Hide Adsense From Social Traffic from Stumbledupon, Digg, Technorati, Etc. The secret is to add a little JavaScript around your Ads, so that they will only be displayed if the visitor comes from a search engine.
There is plenty of authority for hiding your ads from social traffic so you can increase your adsense CTR (from Grizzly’s Make Money Online Blog) and not have a lot of “views” that won’t ever get clicked. Here’s a direct quote from Vic Franqui; “One last thing - if you get a lot of social media traffic don’t run adsense. Only use adsense if you draw targeted search engine traffic”.
- How It’s Done.
So now you can run Adsense even if you get masses of Social traffic - If you run a WordPress blog you can use the ozh who sees ads plugin, but there is no easy plugin for Blogger or your normal website, so I have made up some JavaScript to use anywhere you want to show your ad to search traffic.
- Wrap the ad in an “iframe”
Some ads like Amazon have the code already wrapped in an iframe, so all you need do is wrap this (green) Script, around your ad code (red). The script detects if the referrer is Google, Yahoo, etc and displays the ad.
<script type=”text/javascript”>
<!––
var myArray = [];
myArray[0]= ‘/search?’;
myArray[1]= ‘.yahoo.’;
myArray[2]= ’search.’;
myArray[3]= ‘/search/’;
myArray[4]= ‘images.google.’;
for(var i=0;
i<5;
i++) {
if (document.referrer.indexOf(myArray[i]) > -1)
{
//––>
document.write(’<iframe src=”http://rcm.amazon.com/e/cm?t=youraccount-20&o=1&p=26&l=ur1&category=computers_accesories&banner=1SKRXV416ZYVKCEGXQR2&f=ifr” width=”468″ height=”60″ scrolling=”no” border=”0″ marginwidth=”0″ style=”border:none;” frameborder=”0″></iframe>‘);
}}
</script>
Substitute your ad code for the code in red above. This will work with any code that is completely wrapped in an iframe.
- Display Google Adsense
This can be a problem because Blogger, for instance, will overide some scripts you include. The answer is to source the Adsense code from an outside file. Pop your Adsense ad in a plain html file (adsense.htm); upload it to some place you can access; and call it as the source (src) of an iframe -
<script type=”text/javascript”>
<!––
var myArray = [];
myArray[0]= ‘/search?’;
myArray[1]= ‘.yahoo.’;
myArray[2]= ’search.’;
myArray[3]= ‘/search/’;
myArray[4]= ‘images.google.’;
for(var i=0;
i<5;
i++) {
if (document.referrer.indexOf(myArray[i]) > -1)
{
//––>
document.write(’<iframe scrolling=”no” style=”width:125px;height:125px;” frameborder=”0″ src=”http://YourSite.com/adsense.htm” marginheight=”0″ marginwidth=”0″></iframe>‘);
}}
</script>
Edit the above URL (dark red text) to point to where you uploaded your adsense.htm file, and adjust the width, height to match your Adsense ad
- Just Copy and Paste
There you go - paste one of the above sets of script into your web page wherever you want the ad to appear. With Blogger, use an HTML/JavaScript Gadget, or else paste it directly into the HTML template in your header if you prefer.
- Try it and See for Yourself…..
Click on Site Synergy with Keyword Coherence for my Key Word Coherence site and you will see no ads, but Google (or Yahoo) for keywordcoherence and click on the SERP link to that same site and you will see that a banner ad in the header from Amazon and a Google ad in the side bar have appeared, because the referrer was a search engine.
- Tips to the Wise….
Be sure to edit the iframe dimensions to match your ad and check that your edit program paste function didn’t put left and right quotes into the script instead of plain quotes. Get that right and you will have learned how to hide Adsense from social traffic!



[...] How To Hide Adsense From Social Traffic [...]
My goodness, that seems like a lot of work, though it’s probably not. I guess I don’t worry all that much about the type of traffic I’m getting for my blogs, as long as I get the traffic, and I don’t get many clicks there anyway. I tend to get more Adsense clicks from some of my other websites, which are drawing people specifically looking for that stuff; thank goodness.
Mitch´s last blog post..What Makes Twitter Interesting
Hi Mitch
You said; “…..which are drawing people specifically looking for that stuff”. You nailed it right there! That’s exactly what this script is all about, ’cause social traffic waters down your CTR and can cost you lots if you get “smart priced”.
Thanks for dropping in!
Learned something new here. Thanks!
Salwa´s last blog post..Three Keys To Successful Goal Settings
This is interesting. It is normally more difficult to get traffic from Social Media to click on the adsense therefore greatly reducing the CTR. With this code, bloggers might be able to make a little more income. Thanks for the share.
Wei Liang
ABloggerBlog´s last blog post..Lesson 13: Copywriting skills - How To Write The First Sentence
Gidday Wei!
It is exactly that difficulty that this script helps to overcome. I hope your CTR will improve accordingly.
Now this is sweet! I’m saving it if I ever go back to using adsense
Dennis Edell´s last blog post..Are You Like Jack?
Can you show me how to subscribe to your feed via email?
Dennis Edell´s last blog post..Are You Like Jack?
Hi Dennis -
Nice to see you again, of course the script works with anything, not just Adsense……
@Dennis
Same answer as for my other blog at WeBlog I will set up an auto adviser and you should get notification automatically.
Learn something new everyday, Thanks for the Tip!
Larry´s last blog post..Tips On Writing Amazing Blogs
My goodness you really know your stuff, Rhys. I hate social traffic as it always causes some issues with my hosting whenever stumble traffic invades my blog. It’s time to move to VPS now..
Anyway, good to see you, Rhys..
Yan
Blog for Beginners´s last blog post..Ask My Readers #1
@ Yan!
Good Morning to you too. Thanks for dropping by.
BTW. I give you 10/10 for courage with your latest post (AskMy Read…..), and I suspect it will produce real gold in ‘feedback’.

Their are many ways to hide adsense, you can just implement the referer detection in your php-code directly. This way it is even more controlable..
mcguillan´s last blog post..Backlinkgeil - Oder Spammen statt Kommentieren
@mcquillan
Indeed PHP is good, I use php on this blog to do just that, but the point of this particular script was to use a client-side script, rather than a server-side script because it is much easier for those ‘copy and paste’ users, and it works on Blogger, etc, where there are blocking codes that prevent server-side scripts working.

Rhys´s last blog post..How To Hide Adsense From Social Traffic
BizBlog » Blog Archive » How To Hide Adsense From Social Traffic…
Discover How To Hide Adsense From Social Traffic and so prevent your Adsense rewards getting ‘Smart Priced” by Google.
Social sites like Stumbleupon can send you lots of traffic, but statistically it doesn’t ‘convert’ and you CTR can drop very …
Hello
its nice trick
but i think its much better to do it in php
smth like that:
if (traffic form serps or $_COOKIE['myads']) {
show ads;
put or update $_COOKIE['myads'] timelife;
}
I love the ozh who sees ads plugin that I use on my word press blog. But I also have a Blogger site & this post of yours was exactly what I was looking for! Unfortunately, so far I just can’t quite figure out how to get an htm file of my adsense code onto my server so I can point to it in your code here for my blogger site.
central coast california real estate´s last blog post..Santa Barbara Homes for Sale
Hi Centralcoast……
Do a search for free upload and choose one that suits you; or try this one: http://www.geekuploads.com/index.php
This is an awesome post. Thanks for the blogger code. This should be a huge help. Social traffic sucks and most of my sites don’t get it, but its still a nice chunk of code to add when you need it.
Chewbacca´s last blog post..Get backlinks that are strong
Hi Chewbacca -
I know it’s hard to find functional code for Blogger, so I’m happy to be of help.
I endorse your point that we ought to “get backlinks that are strong“!
Rhys´s last blog post..CommentLuv Guarantees Premium Keyword Backlinks
@CCCRE(above)
Whoops, Word Press edit tool suppressed the second hyphen in the comment code of the posted script, so it looked like this <!–
instead of this <!––
It is now corrected - Rhys
Thanks for the correction! This is awesome! I inserted your code on my Blogger blog, and its working like a charm!
There is no other place on the internet (trust me, I searched!) where you can get a free code for this function to use on Blogger. What a valuable tool! Anyone on Blogger who wants to increase their CTR and has social traffic absolutely needs to have this! Thanks for putting this together, Rhys, and thank you for your personal attention and help to me! You rock!
central coast california real estate´s last blog post..Central Coast California Home Loans
Wow, it’s a nice idea to show ads just for search engines traffic. I’ve tried to block ads for some social networks before but this way is much broader. I’ll try it on 1 of my blogs.
webkinz´s last blog post..Virtual Images for January Webkinz 2009
Wow - I’ve never heard of this before! I had no idea that you should hide AdSense from some visitors, let alone how to do it. I’m happy I ran across your blog, and I’ll have to look into implementing this tip. Thanks!
Adventurous Wench´s last blog post..So there we were.. power lounging at White Bay
sounds interesting and seems to be a nice trick.