Welcome to WebmasterWorld Guest from 18.204.227.250

Forum Moderators: martinibuster

Message Too Old, No Replies

adsense and bottly.py includes

can include adsense code in a %include

     
7:23 pm on Jun 30, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts: 2714
votes: 823


I am creating a new site using bottly.py. My standard page headers and footers are added to the pages using the bottle.py's simpletemplate command %include.

I realized that my ad units are also standardized across most pages. Can use the %include to add the ad-code? Does this cause any technical issues with Adsense's JS? Does it cause any policy issues? The benefit is that I will have the ad code included in few template files and I will be able to modify it very easily for the whole site without having to mess the with the individual page templates.
7:58 pm on June 30, 2016 (gmt 0)

Administrator from CA 

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

joined:Apr 8, 2003
posts: 3883
votes: 61


No technical issues. I do it all the time for other JS.

This is functionally the same as a server side include so can't really see any policy issues either.
8:09 pm on June 30, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts: 2714
votes: 823



Thanks bakedjake, have you tried this specifically with Adsense.

I added the ads using the %include and I am running locally on my localhost in debbug mode. It appears to work but the images for some ads are not loading, I think this is due to Flash being blocked in the browser I am using for testing and thus has nothing to do with the include.
8:20 pm on June 30, 2016 (gmt 0)

Administrator from CA 

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

joined:Apr 8, 2003
posts: 3883
votes: 61


It may be a CORS thing too. Check the JavaScript console.

I've not tried it with Adsense but it should work ok.

I can try this when I get home to be sure.