HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[RESOLVED] Google Adsense

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#64833 (In Topic #13954)
Avatar

Fan in action

I would like to use Google Adsense

Is there a way to use Google Adsense with ocPortal? If there is can someone walk me thru the steps to do so? Thanks.
Back to the top
 
Posted
Rating:
#64884
Avatar

Well-settled

i just insert google adsens in my site. first obtain google's code (from their site; you have to follow 3 or 4 easy steps) afte that decide the place where announce will apear. edit that page and insert codebox :
here copy/paste the googe'scode
its my first time when i explain something. i am a beginer too; but that issue i have just resolved after many hour of reading on tutorials… so i hope it will help! best regards
Back to the top
 
Posted
Rating:
#64885
Avatar

Well-settled

i cant show you the html code. te message editor interpret like a html not like a text; and i dont know how to resolv that. i have told you that i am newbie.
sorry for my helplessness
Back to the top
 
Posted
Rating:
#64894
Avatar

Go to this location: Admin Zone -> Setup -> Configuration -> Feature Options.

Then in the "Banners" section, paste the Google code into the "Money advert-code" box.


Like ocPortal on Facebook:
Back to the top
 
Posted
Rating:
#65659
Avatar

Well-settled

O_o Okay, I put the google adsense code into the "Money advert-code" box. The result is that one google adbox shows up on the right top of every page over the top of whatever else belongs there. How do I make it go only where I want it and can I have more than one type of Google ad box?
Back to the top
 
Posted
Rating:
#65661
Avatar

Put it into whatever templates you want to put it in. Really it's no different than the way you'd usually use it – just instead of editing raw HTML files you edit the templates the HTML is fed from.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65708
Avatar

Well-settled

Thanks Chris,

I understand how to insert the google code into the HTML page. I use Adobe GoLive.

So, I understand the template system and have successfully made a couple of small changes to the templates for my site. However, when I insert the code into a template, it does not show up.

Here is what I did. I looked at the page through "Edit Templates" at the bottom to find the templates on the page. I decided to use the Shoutbox since I won't want that on my site. I put it into the right column where I want the ad and replaced the shoutbox script with the google ad script. Nothing happened. I tried different combinations, but nothing happened except crashing the page and having to replace the orginal code for the template.

Is there a precise way for me to put the google code into the template? Or should I use a different template?
Back to the top
 
Posted
Rating:
#65713
Avatar

I'm updating the banners tutorial with the following text:

In order to use banners from an existing banner network, you often are asked to incorporate a chunk of HTML into your site. ocPortal makes this easy for you, with a config option to store this code ("Money advert-code"). If the config option is empty, then banners for the default banner category (the one by default shown in the top right, 468x60), come from the banner rotation purely; otherwise, a mix between rotation and your hard-coded banner is achieved according to the specified percentage.
If you want a different commercial banner size to 468x60, or multiple banners, it is best to avoid the ocPortal banner system entirely. There is nothing particularly special about how ocPortal handles HTML, and you can put your Google banners in any templates or Comcode pages you wish to (for Comcode pages you will need to use the Comcode 'html' tag and should probably turn the WYSIWYG editor off). If you are having multiple commercial banners and also want to use the standard 468x60 spot for commercial banners you may want (for reasons of consistency, simplicity, and maintenance) to rip out ocPortals banner system entirely and paste your banner code into HEADER.tpl over ocPortals default banner Tempcode. i.e. replace this:

Code

         {$SET,BANNER,{$BANNER}} {$,This is to avoid evaluating the banner parameter twice}
         {+START,IF_NON_EMPTY,{$GET,BANNER}}
            <div class="global_banner" style="text-align: {!en_right}">{$GET,BANNER}</div>
         {+END}
with something like this:

Code

         <div class="global_banner" style="text-align: {!en_right}">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxx";
/* test */
google_ad_slot = "xxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
         </div>

Now I'm going to specifically test this as you've described to see if I can reproduce any difficulties.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65714
Avatar

I think you're probably just coming up against this:
yurko.net Why there is white/blank space instead of AdSense ad on my website?

I got it too. I used Firebug (well, actually Google Chrome's 'Inspect' tool) to look at the HTML for the area where the ad was. The ad iframe was there, but just it was blank.

So it's not an ocPortal issue, just probably your adsense account isn't set up right for your website URL, or something like that.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: