Forum Moderators: martinibuster

Message Too Old, No Replies

Did I change the adsense code?

I streamlined my site code, adsense code to boot, am I breaking the T&Cs?

         

mrMister

9:34 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The other day, I decided to give one of my sites an overhaul. I've been running it for 10 years now and some of the code has been there since day one.

The old site was full of <font> tags and was heavily bloated with code which there's no need for in this day and age.

I had inline javascript as well and the download size per page was a lot more than it needed to be.

I re-build the layout using CSS which is in a separate file and I put all the javascript in a single file. As a result, the pages download a lot quicker.

However, as part of it, I put the adsense formatting code (the variables that define height, width format, etc.) in a seperate .js file.

It now looks something like this...

<script type="text/javascript" src="adsense.js"></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

The thing is, am I breaking the T&Cs by doing this? I haven't modified the code, just placed it somewhere else. Does anyone know if I'm likely to get a ban for this. I don't really want to put the script back inline because it makes the code messy (and a little bit slower).

Has anyone else done this?

[edited by: mrMister at 9:40 pm (utc) on Mar. 9, 2005]

encyclo

9:40 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should ask first before doing it, but I would add one thing: you are not actually streamlining much, as you have an extra call to the server on the first page (slowing down ad retrieval, if only marginally), and the amount of code is tiny anyway. I'm not sure I would bother, myself.

Jenstar

9:43 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it is against the terms. Probably won't get banned, but you would definitely get a warning, and others have gotten one for that kind of situation.

homeblock

9:45 pm on Mar 9, 2005 (gmt 0)

10+ Year Member



If your pages are dynamic there is nothing wrong with using an include line to get the adsense code.

mrMister

9:49 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you have an extra call to the server on the first page (slowing down ad retrieval, if only marginally)

Well, I do my best to make sure latency is as low as it can be for visitors to my server but I get your point. Although, my priority is to those visitors who look at more than one page :-)

There are other benefits... The code is less messy, and the code is in one file, so if I need to change the colour scheme. I think the new code formatting is as a whole better than it was.

mrMister

9:50 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your pages are dynamic there is nothing wrong with using an include line to get the adsense code.

No, it's not dynamic any more. That was another change that I made to improve performance. The old version of the site did use a few include files and it made a call to the database on every connection which I now consider very bad style.

The site is now pre-compiled and saved to disk as flat .html files.

It's a small performance boost, but every little helps.

jomaxx

10:56 pm on Mar 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As Jenstar says, others have been specifically told not to do this.

(Among other reasons, this makes sure that Google has a record of the ad code that you are serving up on every page. If you put the code in an external file, the AdSense bot never downloads and archives it, and Google has no idea what code is being executed.)