How to add google adword contents in each post

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Oct 25, 2008 at 3:38 PM
Hi,

I would like to add my google adwords ads in all my posts in Blogengine.net. I am a .net programmer.
Please tell my how to save my adwords code as a template so that in all the posts i post, the ads are disaplyed automatically above and below the posts.

Thanks,
Nishanth
Oct 27, 2008 at 2:19 PM
This really depends on the type of Theme you're using. They will all be slightly different.
I did this for a client at MostlySafeForWork adding Google AdSense to the OneSoft BE theme BrightSide (of Life) Theme.

Their Google AdSense was added to the /themes/Brightside/site.master file in the following locations:
  • Within the "<div id="content-wrap"> (for a Leaderboard 728x90)
  • Within the <div=id="sidebar"> (for a SmallSquare 200x200)
  • and again within this DIV near the bottom (for a WideSkyscraper 160x600)
  • and finally some AdLinks at the immeidately after the start of the <div id="footer">
The Google AdSense rules are a maximum of three adverts and one adlink per page. "Don't break the rules" with Google AdSense!

Probably the easiest way of hacking your Themes' site.master is to insert some "text" (eg. Leaderboard, Sky, Links) and spot where that appears once you've saved and reloaded your page. When you then understand where the text is placed, you can then replace with Google AdSense code.

Hope that helps!
Nick
Oct 28, 2008 at 2:49 AM
Nick.. Thanks  a lot for the reply. It was really helpful. 
Nov 18, 2008 at 1:59 PM
In my Shoulders of Giants blog I added a TextBox through the usual admin tools. This allows you to insert the AdSense code as html within that text box.
Nov 19, 2008 at 11:39 AM
Piers - Your posting of the really obvious helped. I really didn't know that feature existed. Maybe I had never scrolled down or missed it on a theme I was using. This is also a neat way of adding a side-menu of links to static Pages. Learning something new everyday!

Nick