Welcome to WebmasterWorld Guest from 54.162.240.235

Forum Moderators: incrediBILL & martinibuster

Message Too Old, No Replies

modifying firefox referral code

Targeting non-FF users

     
5:42 am on Jun 1, 2006 (gmt 0)

5+ Year Member



The TOS say that we're not allowed to modify the adsense code. What about if I only want a Firefox referral button to appear in non-Firefox browsers? I assume that if I wrap the supplied javascript in an if statement then that's not modifying it, but I can't get javascript to do a conditional <script type="text/javascript" src="..."> However, using document.write('<script type="text/javascript" src="...">') I can get it to work.

Would this be legal? Or more generally, does modifying the adsense code as mentioned in the TOS refer to the code generated on the adsense site, or does it refer to the .js file that's downloaded from the google server?

Thanks in advance.

7:05 am on Jun 1, 2006 (gmt 0)

5+ Year Member



I think this is too close to modifying the code.

If I were you, I'd head over to the PHP forum and get a PHP solution. That way, the code won't even exist if the user has Firefox.

8:01 am on Jun 1, 2006 (gmt 0)

10+ Year Member



You could always try putting the Firefox referral code in a conditional comment, wich incidently only is supported by Internet Explorer:

<!--[if IE]>

Referreal script

<![endif]-->

That wouldn't modify the actual code but only display it to IE users.

12:12 pm on Jun 1, 2006 (gmt 0)

5+ Year Member



I use this PHP solution:


<?php
if(stristr($HTTP_USER_AGENT, 'firefox') === FALSE)
{
// Show Firefox ad
}
else
{
// Show some other ad
}
?>
4:35 pm on Jun 1, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld alexisw,

though that only works if you have register_globals on barns

this would be better

<?php
if(stristr($_SERVER['HTTP_USER_AGENT'], 'firefox') === FALSE)
{
// Show Firefox ad
}
else
{
// Show some other ad
}
?>

[edited by: jatar_k at 2:04 am (utc) on June 2, 2006]

1:49 am on Jun 2, 2006 (gmt 0)

5+ Year Member



Alrighty, PHP seems like the way to go. Thanks.
8:36 pm on Jun 2, 2006 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



PHP or anything that you can do some limited server side processing. I'm poretty sure you can get the same reseult with mod_rewrite and a few server side includes.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month