Skip to navigation

Skip to additional stuff


Tuesday, November 29, 2005

Don’t bother Firefox users with AdSense Firefox Referrals

Since I can finally use Firefox Referrals within Google Adsense, too, here’s a quick tip for those who put the ads on their sites, but forgot that not everyone needs Firefox (e.g. those who installed it already and are viewing your site with it :D).

If you run Wordpress for example, you can quickly insert this PHP code to show the Firefox ad just to those using not Firefox:


<?php
if(strpos(@$_SERVER['HTTP_USER_AGENT'],'Firefox') === FALSE) {
?>
<script type="text/javascript"><!--
google_ad_client = "pub-4253783154304212";
google_ad_width = 120;
google_ad_height = 60;
google_ad_format = "120x60_as_rimg";
google_cpa_choice = "CAAQ2eOZzgEaCD4zuVkdzt_CKI-293M";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php
}
?>

If you want to show something else when the user is using Firefox (for example an AdSense banner):


<?php
if(strpos(@$_SERVER['HTTP_USER_AGENT'],'Firefox') === FALSE) {
?>
<script type="text/javascript"><!--
google_ad_client = "pub-4253783154304212";
google_ad_width = 120;
google_ad_height = 60;
google_ad_format = "120x60_as_rimg";
google_cpa_choice = "CAAQ2eOZzgEaCD4zuVkdzt_CKI-293M";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php
}
else {
?>
<script type="text/javascript"><!--
google_ad_client = "pub-4253783154304212";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "F4F4F4";
google_color_bg = "FFFFFF";
google_color_link = "142A3B";
google_color_url = "142A3B";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php
}
?>

You can use the code above directly, or replace it with your own so you actually earn the money.

9:38 am | Filed under: , , 6 Comments | the j-blog

6 Comments on “Don’t bother Firefox users with AdSense Firefox Referrals”

  • 1.
    Posted by
    seweso
    2005-11-29
    1:55 pm

    The idea is that when someone already has firefox he/she will install the google toolbar! So the link is not useless for firefox users.

  • 2.
    Posted by
    kunal
    2005-11-29
    1:56 pm

    but isnt it mentioned in their TOS that nothing should be fiddled within the code. and if its legal can this be applied to blogger blogs?

  • 3.
    Trackback by
    The Future Of The Web
    2005-11-29
    2:01 pm

    Hide Firefox Referals From Firefox Users

    I’m glad Julian Bez pointed out we don’t have to bother Firefox users with Adsense Firefox referals. Just yesterday, Google opened up Firefox referals for International content providers. I immediately added the banner to the Tools page of this s…

  • 4.
    Posted by
    Julian
    2005-11-29
    3:16 pm

    @seweso: You don’t get money if the user has already Firefox installed.

    @kunal: The code is modified in no way. So no problem here.

  • 5.
    Posted by
    Usman
    2005-11-30
    8:55 am

    thanks buddy!

Leave a comment

Your e-mail address will never be displayed.

(required)

(required)



Navigation



© Copyright Julian Bez 2010. All rights reserved, unless otherwise mentioned.
For your convenience: All times are GMT.
Built with valid things such as XHTML and CSS.

PLEASE NOTE: This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. more info...