Forum Moderators: martinibuster

Message Too Old, No Replies

Adsense code block playing

         

adnanp78

10:48 am on Mar 6, 2007 (gmt 0)

10+ Year Member



I wish to forbid displaying adsense vistors from my city
I wrote this code:
**************
<script language="Javascript" src="http://ip_location_site">
</script>
<script language="Javascript">
if(my_city!= "Miami" )
{
ADSENSE FULL CODE BLOCK!
}
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
*******************
This code works well, My question is do I break a Google advertisment policy.
What do you think will Mr.Gooogle would allow to do this?

wheelie34

11:40 am on Mar 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi
I would rather call an include file

if (!$my_town)
{
include (adcode_file.txt);
}
else
{
include (other_advert.txt);
}

Rathre than splitting the google javascript just call the whole bunch in a text file. If you dont want to do that and use your idea, best ask Mr Gooogle.

adnanp78

12:46 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



Tnx wheelie34.
Well i'm just not 100% sure if your suggested code is javascript compatible and what will Mr Google say when he DOESNT see adsense code on the page.

I want to you javascript because that way the adsense code will always be in the source, but won't be displayed for certain (Miami) users. My question is, is it code playing alowed.

Ps: I take this job very serious and dont want to break policy
Tnx wheelie34 and other for suggestions.

wheelie34

12:59 pm on Mar 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



my code relates more to php sorry, I don't do javascript, personally I wouldn't alter the adsense code.

Mr google wont get upset if he doesn't see adsense code on your pages, its up to you if you put it there or not, why not ask in the javascript forum here at webmasterworld [webmasterworld.com ] for advice on an approach similar to what I gave you in php, there MUST be something for javascript there.

PS: welcome to webmasterworld

joelgreen

1:29 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



It must be server side solution because:
- you are not allowed to change javascript code. It should either include whole ad code (both <script> tags) or nothing at all.
- when playing with ad code using javascript you are actually very close to generating invalid impressions (depending on realization), because ad could load (impression counted) and you just would not show it.

adnanp78

1:47 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



Hmm, my server is Microshi.oft :) So i cant use php. And olso any other server technology becose geolocation of my "miami" clients is tergeted using CLIENT SIDE service [ip_location_site_service...]

This code work perfectly!
*****************************************************
<script language="Javascript" src="http://www.ip_location_service_site">
</script>
<script language="Javascript">
if(Geolocation!= "Miami" )
{
google_ad_client = "pub-yyyyyyyyy";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "#*$!#*$!#*$!";
}
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
******************************************************

but.... question is just how legal is it to use, policy & co...

Whatever Thenk You very much and best Regards

adnanp78

1:49 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



yessss joelgreen
You have full right.
I dont play anymore ;)