Setting up Google Ads in ocPortal

adsenseAdvertising can be an important part of any website. This could be selling advertising space such as classified ads. ocPortal also supports banner advertisements which you could sell adverts in and through this tutorial I want to go through the process of setting up Google AdSense.

Google AdSense are adverts which tailor to the content on the page. I am sure everyone has seen them; they are a number of text based adverts which appear on many websites. These adverts are taken from users who have set up an Adwords account to advertise their website and have ticked the option to display their advert on the display network as well as next to search results.

The first thing you need to do to be able to set up your AdSense adverts is follow through Google’s process to create an account.

Once you have completed the form you have to wait until your application is accepted. Assuming your application is accepted, you will need to set up your AdSense ads. There is a bit of a catch 22 with AdSense for a brand new site as they won’t accept an account until there is some proper content and your site is fully built. This means you may have to use a place holder for a while or leave some blank space where the AdSense ads will go until you have been accepted.

If you haven’t used this before I recommend running through Google AdSense academy which can be found here:

If you want to replace the existing banners with AdSense banners in the header you need to set Google AdSense to 468×60 or you will need to edit the styling to make the banners fit

If you are going to place the banners in the Panel_left or Panel_right,  the width and height will depend on the size you have set your panels to be. If you have not changed the styling then 200px wide should fit fine.

Once you have set up your adverts Google will provide you with the necessary code to place on your site to make the ads appear. It will look something like this

<div class=”adsense_banner” style=”text-align: {!en_right}”>
<script type=”text/javascript”><!–
google_ad_client = “ca-pub-xxxxxxxx”;
/* test */
google_ad_slot = “xxxxxxxxx”;
google_ad_width = 200;
google_ad_height = 400;
<script type=”text/javascript”

The div title “adsense_banner” I have added as this will allow me to add CSS styles to the global.css to help position the ads where I want them.

Looking for quality Hosting for your ocPortal website? Look no further than Arvixe Web Hosting!

If you want, you can Follow me on Google plus or Follow me on Twitter

Tags: , , , , , , , , , , , | Posted under ocPortal | RSS 2.0

Author Spotlight

Steve Jarvis

Hi I'm Steve, I've been using computers in one form or another since i was 5 with a Dragon 64 and building websites since the late 90's. I'm currently employed as a digital marketing person for Planet X Bikes. When not writing blog posts or working i'm a family man (Wife and Daughter) and a PC Gamer

Leave a Reply

Your email address will not be published. Required fields are marked *