Forum Moderators: martinibuster

Message Too Old, No Replies

adsense and bottly.py includes

can include adsense code in a %include

         

NickMNS

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

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.

bakedjake

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

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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.

NickMNS

8:09 pm on Jun 30, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




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.

bakedjake

8:20 pm on Jun 30, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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.