Is it possible to display ads by placing adsense code in external js file and then reference to it from files. Somehow I can't make it posibble without changing the adsense original code and I know it's against their rules. And has anyone done this this, please post your expiriences. I know it can be done with php but I want to do it this way. Also I've done a search through this forum about this topic and found a few threads but couldn't find the right answer.
To put the code in an external .js file, I think you have to strip off the script tags. If you do this, this is modifying the code. A TOS violation. Follow mdvaldosta's suggestions. tom
Yes, I contacted adsense tech support concerning this issue, and they also suggested using php, they also said that if there is a way of placing the code is js file without changing it that they are unaware if it.
If you have a common theme throughout your site, html editors like DreamWeaver have templates, and libraries for replicating design/code changes through your pages. hth, tom
hello all! how can i put adsense code in index.php ? i want to use "Leaderboard (728 x 90)" with left alignment .. what is the code for this plz ?
You could possibly use: document.write('<adsense code>'); You wouldn't be modifying the code then... Just writing it into the document at request time
SSI is the way to go. Think about it. If you want to change the style of the ad, it's easier to change one file than 5000. Also, heaven forbid that you get banned...then you get accepted by another ad serving outfit. Without SSI you have to go in and manually change all the google adsense to yahoo or wherever. With SSI you change one file for each ad layout and you're done much sooner...and you also know you've changed them all.