Back to top

Only Show Firefox Referral to IE Users

For a little while now Google has been offering a payment for referrals of an IE user that result in a "Firefox with Google Toolbar" installation. (that links to information about the program, not a link that would make me money).

The thing is, they only give you credit if someone who is using IE on Windows is "converted" to Firefox with Google toolbar. So, there's no point showing the referral button if the visitor to your site is already a Firefox user (or is a Safari or Opera or Camino or MacIE user). In that case, you can show a completely different ad or no advertisement at all. I wanted to do this and found lots of solutions that involve the use of javascript. I hate javascript. So, here's my solution that uses PHP variables:

<?php
if (strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) :
?>
--put your Internet Explorer specific advertising here--

<php else: ?>
--either skip this whole block or put your non IE advertising here--

<?php endif; ?>

For what it's worth, I've noticed this problem on lots of sites...but got inspired to write about it when I was reading Alexander Kjerulf's Chief Happiness Officer blog. He's written some great stuff. It's only fitting he has a high performance (and high converting) site to go along with it.

People Involved: 
timeline: 

Comments

Thank you

Thanks Greg for an early Christmas present. That's brilliant - especially because it's not javascript :o)

I've already implemented on the site and it works!