free geoip CS Tidbits #17: How To Add Advertisements To Your Blog - protected virtual void jaysonBlog
in

jaysonKnight.com

Welcome to my corner of the internet

protected virtual void jaysonBlog

A conduit to the voices in my head

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.

Share this post: Submit CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to Technorati | Submit CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to del.icio.us | Submit CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to digg.com | Submit CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to reddit.com | Submit CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to DotNetKicks | Add CS+Tidbits+%2317%3a+How+To+Add+Advertisements+To+Your+Blog to Live Bookmarks
Only published comments... Aug 14 2006, 10:15 PM by Jayson Knight
Filed under:

Comments

 

Community Server Daily News said:

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

August 15, 2006 1:24 PM
 

ASB said:

Nice article, Jason.

August 17, 2006 7:27 AM
 

Mike Cooper said:

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

Thanks

August 21, 2006 10:57 AM
 

Jayson Knight said:

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

August 21, 2006 12:58 PM
 

Kingsley Tagbo said:

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

August 27, 2006 2:35 AM
 

Jayson Knight said:

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.

August 27, 2006 7:45 PM
 

Community Server Bits said:

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

March 12, 2007 9:38 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Jayson Knight

Jayson Knight was clueless to the computer programming world until he took a C++ class in college. The rest is proverbial history. He has been building applications targeting the .Net framework for 7 years, focusing mainly on internet technologies and database driven web application development.

Most recently he left the world of Corporate IT to finish up his degree in Chemistry, with an eye on Medical School and an Anesthesiology residency program. Read this post for more information.

He is also a Community Server MVP: Community Server is the software that runs this site, plus many others on the web. For more information, check out http://csmvps.com.

When he finds time to pry himself away from his computer and university studies, he can be found on the mountain bike trails when it's warm, and on the ski slopes when it's cold.

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

Terms of Service/Privacy Policy