Welcome to WebmasterWorld Guest from 54.162.232.51

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)

New User

10+ Year Member

joined:Nov 23, 2005
posts:2
votes: 0


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 June 1, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 12, 2005
posts:411
votes: 0


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 June 1, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:May 13, 2003
posts:442
votes: 0


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 June 1, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 6, 2005
posts:575
votes: 0


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 June 1, 2006 (gmt 0)

Administrator

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

joined:July 24, 2001
posts:15756
votes: 0


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 June 2, 2006 (gmt 0)

New User

10+ Year Member

joined:Nov 23, 2005
posts:2
votes: 0


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

Senior Member

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

joined:Aug 7, 2003
posts:4783
votes: 0


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members