free geoip CS Tidbits #17: How To Add Advertisements To Your Blog - Jayson's Blog - jaysonKnight.com
jaysonKnight.com
Welcome to my corner of the internet
CS Tidbits #17: How To Add Advertisements To Your Blog

Piggy Bank 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.


Posted Mon, Aug 14 2006 10:15 PM by Jayson Knight
Filed under:

Comments

Community Server Daily News wrote Community Server Daily News for Tuesday, August 15, 2006
on Tue, Aug 15 2006 1:24 PM

news of the day a grab bag for what&#39;s happening in Community Server We&#39;ll begin today&#39;s news

ASB wrote re: CS Tidbits #17: How To Add Advertisements To Your Blog
on Thu, Aug 17 2006 7:27 AM

Nice article, Jason.

Mike Cooper wrote re: CS Tidbits #17: How To Add Advertisements To Your Blog
on Mon, Aug 21 2006 10:57 AM

Where are these skin files in CS 2.1?  I think the names have changed.

Thanks

Jayson Knight wrote re: CS Tidbits #17: How To Add Advertisements To Your Blog
on Mon, Aug 21 2006 12:58 PM

Mike, they are located in Themes/Blogs/<yourThemeName>/Skins/. They haven't changed names.

Kingsley Tagbo wrote re: CS Tidbits #17: How To Add Advertisements To Your Blog
on Sun, Aug 27 2006 2:35 AM

Is there as a CSModules that can inject ads automatically inside a blog post or in the positions you just described on a blog?

Jayson Knight wrote re: CS Tidbits #17: How To Add Advertisements To Your Blog
on Sun, Aug 27 2006 7:45 PM

Hey Kingsley, not that I know of but there is a similar module in the CSMVP module pack we just released:

http://csmvps.com/blogs/news/archive/2006/08/14/Community-Server-MVP_2700_s-Alabaster-CSModule-Package.aspx

It's the Syndication Ads module. Source is included so that should be a good jumping off point for you. It should be trivial to write.

Community Server Bits wrote How To Add Advertisements To Your Blog
on Mon, Mar 12 2007 9:38 AM

We&#39;ll begin today&#39;s news by snagging ourselves a fresh CS Tidbit from Jayson Knight titled &quot;How

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy