bad samaritan last in line for the nobel peace prize. first in line for pie.

Thursday, June 15, 2006

Adsense Affiliate Firefox Hack

Recently, Google opened up a referral program where by if you refer a user to FireFox with Google Toolbar, you earn $1, and if they get an AdSense account and earn $100, you also earn $100. But you dont want to advertise "Get Firefox" to users running firefox, do you? (I dont see it as being much of a money-maker) so with a little coding we can select what size image, and which image (Firefox or Adsense) the user should see based on their browser information. As you know the ads come in 5 sizes. So first and foremost we have to make our php file, we are going to call it "myad.php", and put the following code in it:

if (!isset($ff)) {exit("No ad size defined");}
if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") > -1) {
if ($ff == 1) {echo "Javascript code for size 1 Firefox ad";}
elseif ($ff == 2) {echo "Javascript code for size 2 Firefox ad";}
else {
if ($ff == 1) {echo "Javascript code for size 1 AdSense ad";}
elseif ($ff == 2) {echo "Javascript code for size 2 AdSense ad";}
And so on until all 10 of your ads are loaded into the file.

Now the process if displaying the ad that targets the users you want, simply insert the following code in the place you wish for the advertisement to be displayed:

$ff = 4; //Size of the ad to display (1-5)include("myad.php");

And the ad the uesr would be most likely to click is displayed. As you can see it wouldn't be hard to add more specifics to this code, however considering you only earn the $1 for users who have never had Firefox installed on their computer before, there isn't much need except to target Internet Explorer users for Firefox, and AdSense for all other users. And finally, any support I get from you guys is extremely appreciated Get firefox if you dont have it, you are missing out. And Google Adsense can make you webmasters some serious money!


Post a Comment

Links to this post:

Create a Link

<< Home

View Google AdSense for URL:

Brought to you by Acme Technologies

All Rights Reserved, including copyrights, service marks and trademarks.