homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & jatar k & martinibuster

Google AdSense Forum

    
modifying firefox referral code
Targeting non-FF users
alexisw




msg:1428128
 5:42 am on Jun 1, 2006 (gmt 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.

 

Jeremy_H




msg:1428129
 7:05 am on Jun 1, 2006 (gmt 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.

Nikke




msg:1428130
 8:01 am on Jun 1, 2006 (gmt 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.

barns101




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

I use this PHP solution:


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

jatar_k




msg:1428132
 4:35 pm on Jun 1, 2006 (gmt 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]

alexisw




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

Alrighty, PHP seems like the way to go. Thanks.

swa66




msg:1428134
 8:36 pm on Jun 2, 2006 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google AdSense
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved