Tag Archives: Google Adsense Ads

Howto add adsense advertisements to your StatusNet micro blogging social Network

howto-add-adsense-to-statusnet-social-network-free-twitter-like-service
If you’re running your own statusnet micro blogging network and you happen to have a lot of content inside which you want to monetarize, sooner or later you will think of embedding Google Adsense advertisements to StatusNet.

I’ve found few discussions online like the thread on statusnet forums.
However there is no clear tutorial online yet explaining how to add adsense to statusnet, therefore, I decided to write this little guide.

Luckily StatusNet has a special Adsense Plugin enabling you to include adsense advertisements into your statusnet.

To enable advertising, you must sign up with Google Adsense and get a client ID.

https://www.google.com/adsense/

You’ll also need to create an Adsense for Content unit in one
of the four sizes described above. At the end of the process,
note the “google_ad_client” and “google_ad_slot” values in the
resultant Javascript.

If you’re a programmer check out StatusNet Adsense Plugin code in

/var/www/statusnet/plugins/Adsense/AdsensePlugin.php

Even if you’re not a programmer it is quite easy to add new Adsense sizes, however you have to be sure the new size placement in browser will show correctly.

The way to enable / use the plugin is to add in your /var/www/statusnet/config.php

line:

addPlugin(‘Adsense’, array(‘client’ => ‘ca-pub-6964339082113074’, ‘rectangle’ => ‘2824360868’));

The general Syntax of addPlugin(); is

addPlugin(‘Adsense’, array(‘client’ => ‘Your client ID’, ‘rectangle’ => ‘slot’));

Where client should be your adsense code google_ad_client,

rectangle field could be one of the values:

‘mediumRectangle’, ‘rectangle’, ‘leaderboard’, ‘wideSkyscraper’

Each of this values should be selected based on the width and size of the Google Adsense Ads to be shown.

Here are the general sizes:

MediumRectangle – To show Ads sized width 300 height 250 (300×250)

rectangle – 180×150

wideSkyscaper – 160×600

Leaderboard – heigh x width ( 728 x 90 )

Note that:
Some StatusNet themes might interact quite poorly with this plugin.

It could take some time until ads start appearing on page as after generation in adsense to make it working it takes up to 10 / 15 minutes for it to become active

Once config.php is saved check out, whether Adsense advertisements will appear in the left top of your StatusNet, right below the Search field, like on below screenshot.

adsense-advertisements-on-my-statusnet-social-network-howto

If it doesn’t appear there and you have the code embedded scroll down to StatusNet and check out whether adsense ads are not partially visualized (this sometimes happens if you try to insert adsense code with dimensions bigger than the size of its right pane, if that’s the case you should see your Ads visualize somewhere on the bottom left of page.

Well that’s all, hopefully if your statusnet gets a good traffic and is frequently updated you will start making money with adsense.