Over the past few months I've received several emails from visitors asking how I embedded advertisements into my site outside of the normal places CS allows you to automatically insert ads (when you enable ads in Control Panel, they are sitewide for the main application pages and are placed in the header and footer, however individual blog pages do not have the ads inserted, so you have to manually edit your skin files to add the ads), such as in individual posts, or in the blog header. It's actually quite easy once you understand how the skin files work, but for a new CS user it isn't very intuitive. This post will apply to Google Adsense, but should work for just about any service that provides you with code for your ads.
First off, you need to enable the proper markup in your CommunityServer.config. By default, CS is quite restrictive in what HTML elements it allows to be rendered (which is a good thing as it cuts down on potential XSS attacks); if it's not allowed, the markup gets stripped out. Assuming your ads are javascript based, you'll need to add the following line to the <MarkUp> section of your CS.config file:
<script src="true" type = "true" language = "true" />
After doing that, onwards to adding the ads themselves. The number one place to have ads on a site is in the header...they generally will outperform all other areas. To add your ad code to your individual blog header, you'll need to edit the Blog-TitleHeader. file (all skin files mentioned are located in Themes\Blogs\Default\*) and add your code above the CommonTitle div.
Another place that is becoming more and more popular to have ads is in an individual post itself between the end of the post and the comment section. For sites (such as mine) that are largely driven by Google traffic this is a no brainer, and I've noticed very good performance for this location on my site. The skin file you'll need to edit for this is Skin-EntryViewContainer; add your code beneath the <Blog:EntryView> control.
And finally if you'd like to have ads displayed in the footer of your blog, open up Skin-EntryListContainer.ascx underneath the <Blog:EntryList> control. I'm not a huge fan of ads in footers simply because they don't get too much airtime, i.e. users rarely scroll all the way to the bottom of a site, but it's an option nonetheless.
It's that easy! There are folks out there who are adverse to ads on sites, but if tastefully done (which I hope I've done on my site) they should blend in just enough to not be distracting, but stand out enough to get attention to make them worthwhile. It's about as close to "free" money as you can get; I usually earn a couple bags of groceries each month (or a tank of gas if you want to look at it that way). For site admins this is an easy way to generate some extra revenue from your site.
Share this post: 
|

|

|

|

|
