Welcome to WebmasterWorld Guest from 54.211.136.250

Forum Moderators: incrediBILL & martinibuster

Message Too Old, No Replies

Got email off google.. need to remove ads from search, login and

register page. Javascript help please!

   
7:01 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Hey all, ive recieved an email from google saying im not allowed my banner on my search, register and login page.

Problem is, my website is a forum which uses a global header. So the adcode is in there and automatically gets put on the register login and search page.

Here are the pages I DONT want the code on..
/index.php?act=Search
/index.php?act=Reg&CODE=00
/index.php?act=Login&CODE=00
So, Id like some javascript to go around the banner code something along the lines of..

If ((url = register_page) OR (url = login page) OR (url = search page))
{
dont do anything
}
else
{
google ad code in here
}

Can anyone help with this, I thought about getting the URL, and checking to see if charat wherever the R for register in the url should be is an R.. etc..

Hope you understand,

Cheers
Tom.

7:07 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Why not exclude in the php by checking the act parameter?
7:19 pm on Mar 22, 2004 (gmt 0)

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



Check out the support site for the forum software you run - chances are, this has been discussed and can tell you what files to edit, rather than using the header for AdSense inclusion.
7:22 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Im not quite sure what you mean, I have pasted the ad code into my forum header (its a 'skin' so it only allows you to edit the html to display the page, and none of the internal php which makes the forum tick).

Seeing as I have removed my google ad until I get it sorted, you may as well have a look -

<snip>

The advert is 'hard coded' into each and every page automatically as its the global header.

Cheers for the reply but I dont quite understand :S

[edited by: Jenstar at 4:21 pm (utc) on Mar. 23, 2004]
[edit reason] NO URLS as per TOS, please! [/edit]

9:24 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Ok, got it sorted, just incase anyone else is interested.. heres the code.
Basically looks for the words 'search', 'reg' and 'login' in the url, and if it DOESNT it displays the ad. Cheers for the suggestions.

<script language='JavaScript' type='text/javascript'>

var url = window.location.href;

if ((url.indexOf("Search")!= -1) (url.indexOf("Reg")!= -1) (url.indexOf("Login")!= -1))
{
document.write("");
}
else
{
google code.
}
</script>

9:37 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



tomturd,

I do not want to cause a panic for you, but it looks to me that you have changed the AdSense code!

I'm not sure if you are aware of this, but you are not allowed to do this!

Your AdSense code looks like this to me (and I guess all others who look at it!)


</style>
<script type="text/javascript"><!--
google_ad_client = "pub-REMOVED";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as";
//--></script>
</head>

It also looks like you are missing the

http://pagead2.googlesyndication.com/pagead/show_ads.js
part..

Noel

[edited by: Noel at 9:51 pm (utc) on Mar. 22, 2004]

9:39 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Here is how my site is layed out somewhat, and how I do this:

Lets look at my login page:

login.php:
<?
$googlead = "off";
include('header.php');?

content here....
content here....
content here....

<? include('footer.php');?>

Now lets take a look at my header.php:
content here....
content here....
<?php if($googlead!= "off") {
display google ad
}
?>

That's how I do it, somewhat.. and it works great.

9:40 pm on Mar 22, 2004 (gmt 0)

10+ Year Member



Wait a minute -- I thought the new TOS said you COULD have Adsense on search results?

Anyone clarified this with Google, or should I email them and ask?

8:25 am on Mar 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone clarified this with Google, or should I email them and ask?

Yes, you are allowed to have ads on internal search results. I emailed some time ago and got a positive response.
9:01 am on Mar 23, 2004 (gmt 0)

10+ Year Member



Really? I've held off putting AdSense on my inhouse search results just because of the restriction.
9:09 am on Mar 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, and I believe the new TOS already reflects this, or at least it doesn't say it's not permitted.
9:26 am on Mar 23, 2004 (gmt 0)

10+ Year Member



The Program Policies still say (under Ad Placement) that ads must not be displayed on any registration pages. There is no longer a mention of search pages, though, and I distinctly recall reading somewhere that it was now explicitly allowed. (Perhaps it was in one of Jenstar's summaries, but I can't find it right now.)
4:23 pm on Mar 23, 2004 (gmt 0)

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



It is no longer a TOS/policy violation to put AdSense on internet search pages (search pages that only display results from your own page).