Forum Moderators: martinibuster

Message Too Old, No Replies

Adsense code in separate JS file

Is it against the TOS?

         

fischermx

10:52 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know that TOS says we should not modifiy the javascript code for adsense.
But what about putting the code in a separate JS file, just to clean up your pages?
Anyone using this technique?

ann

11:12 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



that is something I have wondered about myself.

Anyone have ideas on this?

Ann

Sierra_Dad

12:26 am on Jul 26, 2005 (gmt 0)

10+ Year Member



Doesn't sound like it to me. Doesn't sound different than putting it in a csss or other file.

But I'm no expert. What did Google say?

Sootah

12:53 am on Jul 26, 2005 (gmt 0)

10+ Year Member



Just use a server side include to do it, then all you have to do is put your Google code in a seperate text file.

The code looks like this:

<!--#INCLUDE FILE="AdSense.txt" -->

It also makes menus and the like easy cause then you just include the file on your pages and you've only got one thing to edit.

I do my menu's, AdSense blocks, sitewide links, etc this way. Basically anything that will be on multiple pages I just use as an include.

What's nice, is to the end user the HTML looks as if it was hard coded on the page cause the server inserts it in for you.

hyperkik

1:24 am on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I read a note from Google a while back that, while this was possible, it would result in the matching of the ad to the separate javascript file, not the page into which the file is loaded. I would not use an external javascript file without first verifying that the algorithm had been improved such that the ads would be matched to the page content.