Showing the Adsense Firefox Referral Button to Non-Firefox Visitors
Filed in: Adsense Tips, Make Money Online, Open Source, Web Development — February 23rd, 2006
There is no point showing the Firefox Adsense referral button to existing Firefox users. I used the following simple PHP code to show Firefox referral button to non-Firefox (Gecko) visitors only.
-
<!-- PASTE YOUR GOOGLE ADSENSE FIREFOX REFERRAL CODE HERE -->
-
<?php } ?>
Simple huh?

Internet Explorer visitors see the Firefox referral banner.

Firefox visitors do not see the Firefox referral banner
Bug?
I want to keep the code as simple as possible, therefore, it can not do deep browser detection. Safari (Mac OS X) users will be treated as Firefox users as well.
Here is the better PHP browser detection script, if you are interested.
Comments Feed
TrackBack URL


February 23rd, 2006 at 5:55 pm
A nice idea.
But its only work in a site that got high traffic like yours.
It will have more variety of user that using different browser.
February 23rd, 2006 at 6:01 pm
my point is “don’t show firefox banner to firefox user”.
February 24th, 2006 at 2:06 am
i am using that too. but I put the advantages of firefox too! open my page using IE to see them
February 24th, 2006 at 6:22 am
hey/. realy nice idea.. thx man..
February 25th, 2006 at 12:07 am
Yes Lcf……nice idea.
February 25th, 2006 at 7:15 pm
this is so useful, i only have the detect IE script, and if i put it up, it seems I’m just pointing to those using IE. I hate opera so much
March 2nd, 2006 at 10:17 pm
So long as it prompts IE users to download a more stable and ultimately awesome browser. Then I’m happy! Mac users already have decent browsing capabilities
April 27th, 2007 at 2:52 am
[...] Firefox user, so what’s the point in showing that to me? Solution: I came across a neat trick by LiewCF which detects all non-Firefox users. His trick worked by recognizing all non-gecko browser, so it [...]
August 28th, 2007 at 10:11 pm
Strange, but it is displaying the ad in Firefox too.
February 19th, 2008 at 5:13 am
This one I’ll use on my blog.