Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL & martinibuster

Message Too Old, No Replies

Is this allowed?



6:27 am on Sep 15, 2005 (gmt 0)

10+ Year Member

Our site has a php code statement which displays google ad only when a certain condition is met. It is coded inside Java script, for example say the page is called index.php, it will only display google ad when someone comes in with index.php?id=83473478. Is this allowes?

Will google come to our site and see no ad on that page and start getting suspicious towards it? cuz we do have more than 10000 impression daily.


6:47 am on Sep 15, 2005 (gmt 0)

10+ Year Member

as long as you serve unchanged code on an otherwise legitimate pages. i cant see why you cant do that. i have seen ALTERNATE yahoo and google ads served on the same page


7:32 am on Sep 15, 2005 (gmt 0)

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

Is it / would it be achievable by you sitting there with an FTP terminal up swapping files? Yes? Then how can anyone have any objection to something as natural as adding or removing your ads?

If you really want to be sure, check for google IPs / agents and always show them google ads :)


8:41 am on Sep 15, 2005 (gmt 0)

10+ Year Member

It;s like we putting a line of php include statement to a file (advertisement.php, which shows google ad), but that include statement only appears when an if statement of java script is executed. So normally it will not display the ad if u just go to the direct url.

We just not sure if google will come and check and think why there is no ad on the page but we generate revenue from it.


9:51 am on Sep 15, 2005 (gmt 0)

5+ Year Member

Wouldn't it be easier to use PHP for the lot? Rather than checking javascript conditions?

Just before your Adsense javascript block, using something like:

<? if ($condition == true) {?>All your javascript code here <? }?>

Obviously condition will be something like "$_GET['id']" and true might be replaced with "83473478"

Or if you want it to appear on all pages with an ID, use:

<? if ($_GET['id']!== "") {?>Google Ads Here<? }?>


10:01 am on Sep 15, 2005 (gmt 0)

10+ Year Member

I agree whith MyGen, just wanted to add, that if you want to rank with that page in Google, you might want to lower your ID numer series a bit. I've found that numeric variables over 9000 doesn't work that well with Google, since it is often interpreted as a session ID.

Featured Threads

Hot Threads This Week

Hot Threads This Month