Welcome to WebmasterWorld Guest from 54.162.157.249

Forum Moderators: incrediBILL & martinibuster

Message Too Old, No Replies

AdSense and includes

putting AdSense code into php include

     
8:08 am on Feb 10, 2006 (gmt 0)

5+ Year Member



Hi all,
(I just joined the forum) I am considering putting AdSense on my website, and since the site is brand new, I would like to experiment with different layouts, both page layouts and AdSense positioning. I am thinking of putting AdSense code into php include, and then just calling it from the pages. Basically the idea is to easily and quickly change location of the AdSense adds on all pages (rather then manually editing each page). Since I have no experience with AdSense, I was wondering if there is a potentially issues with this (e.x. not being served relevant ads, etc).
If this has been answered, or this is the wrong forum, please point me in the right direction.
Thanks
8:24 am on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



When somewhere in the php is the original AdSense code stored, no problem.
8:34 am on Feb 10, 2006 (gmt 0)

5+ Year Member



Because everything is parsed on the server, before google gets its hands on your content, including your ads using PHP will have absolutely no effect on thier relevancy.
9:41 am on Feb 10, 2006 (gmt 0)

5+ Year Member



The problem with Include commands is you are calling the code from a different page/file all together. this gets iffy in the TOS.

The TOS clearly states that No Google ad may be placed on any non-content-based pages. Since the code itself is placed on a non content based paged and just INCLUDED on the content page it could really cause some problems?

I use variables and include it on the code of the page I'm showing. Example below. That way there will be no issue.

<? if ($showad=='true'){?>adsense code<?}?>

Overall the spirit of the policies is intact when you use include(but the actually letter of the policy may not be) and a quick e-mail to Google may confirm if this is ok or not.

Mygen is correct--about the final parse. I have no clue if they could even find out that you are using include in your code without access to the actual php file that you uploaded to your server.

10:05 am on Feb 10, 2006 (gmt 0)

10+ Year Member



The problem with Include commands is you are calling the code from a different page/file all together. this gets iffy in the TOS.

By all means check with google, but I can't believe this is the case. Are you really claiming that having the google code in an include file is against the TOS?

I don't think google care how a page is built as long as what is served up is within the TOS.

10:38 am on Feb 10, 2006 (gmt 0)

10+ Year Member



The problem with Include commands is you are calling the code from a different page/file all together. this gets iffy in the TOS.

There is absolutely NO PROBLEM when using Adsense through php include. TOS refer to what the end user views and NOT to the code that serves the content. We are using php include to show Adsense on our websites for the last 2 years and we never had any problems.

12:27 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just make sure that you're not showing the code on non-content pages such as:

- Error pages
- login pages
- thank you pages etc.

And you should be fine

(I think that this is what toomuch72 was referring to)

2:51 pm on Feb 10, 2006 (gmt 0)

5+ Year Member



I dont think it matters that it's put on an empty content page in this situation. include.php does not display as an empty page in the browser. It's just part of the php coding. I have a link.php, header.php, footer.php...all are part of putting php pages together. I think you should be fine.
2:52 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



I think toomuch72 was speaking of such a situation

widgets.php
==============================
<? include 'ads.php'; >?

This is my page about widgets.
It has a lot of contents.
==============================

So, when you go to www.example.com/widgets.php,
You see the page with its contents and the ads.

But if you DIRECTLY go to www.example.com/ads.php
then you will only see the ads, without contents...

But then again, who will ever even know the address of your ads.php page?

3:01 pm on Feb 10, 2006 (gmt 0)

5+ Year Member



In this situation it might be against TOS.

But if you have your index.php, header.php, footer.php, template.php...etc then you ad ads.php thats just blank with ads it will all come together into the site and that's fine.

3:46 pm on Feb 10, 2006 (gmt 0)

10+ Year Member



By all means check with google, but I can't believe this is the case. Are you really claiming that having the google code in an include file is against the TOS?

Um ... not to be odd-man-out here, but Google DID contact me about my include file stating that ads had to be on a content page and that having a file with just the Adsense code was a violation of the TOS. Of course, the include file wasn't linked anywhere, but I did view it by itself to make sure it was working before inserting it into pages (no, I didn't click), at which point, I think the mediabot spidered it and it came to someone's attention.

When I explained that I was just testing it, was going to use it as an include, and that I had no intention of just displaying it by itself, they were sort of okay with that, but I imagine they'd have made more noise if the include page started being viewed by itself.

It is also possible Google has changed its mind about this since then, but I figured I'd at least mention it. :-)

JK

4:16 pm on Feb 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, I wasn't very clear.

When you use an include (footer or header with adsense code) on ALL your pages it may also be displayed on pages with no real content such as login or thank you pages.

There are many forums with adsense in the headers or footers which show on all pages, login, login error, thank you etc etc.

AFAIK this is against TOS.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month