How to add Google Referral code

General project discussion. NOT for help questions.
Post Reply
WebGirl

How to add Google Referral code

Post by WebGirl »

Hi,

I want to add Google Referral code to my webpages - a text link which is in javascript from Google.

I found one recommendation to use User Defined Tags [UDT] for adsense, so I thought I could use it for a Referral:

http://wiki.cmsmadesimple.org/index.php ... le_adsense
Google adsense

get your adsense code from google.

copy paste it as is into user defined tag (in extension -> user defined tags -> add user defined tag) as this code has javascript { and } we need to wrap it inside {literal} and {/literal} otherwise smarty will miss interperet those extra { } as its own. so add {literal} at the top and {/literal} at the bottom.
edit your template in which you want the ads to be shown. check where you want your ads (you might want to wrap em in



) and add call to your user defined tag with {name_of_your_udt}. save

refresh your page, and thats it.
I have tried to create a new UDT, I've added the {literal} and {/literal} tags, and put the javascript inbetween, but I keep getting an error message - Invalid code entered

I also get a Troubleshooting link to click on - but there's nothing there :)

Has anyone else added the Google Referral to their CMSMS?

I'm using CMSMS 1.0.2 "Maui"

Thanks in advance!
Last edited by WebGirl on Sun Sep 09, 2007 11:08 pm, edited 1 time in total.
cyberman

Re: How to add Google Referral code

Post by cyberman »

Have you tried to put the source you got from Google into a Global Content Block?

Btw, in an UDT you have to use PHP primarily ...
Last edited by cyberman on Mon Sep 10, 2007 6:53 am, edited 1 time in total.
WebGirl

Re: How to add Google Referral code

Post by WebGirl »

Hi there cyberman, thanks for replying
cyberman wrote: Have you tried to put the source you got from Google into a Global Content Block?

Btw, in an UDT you have to use PHP primarily ...
Perhaps I misunderstand the use of the Global Content Block?  I've used it to put in my web stats code which is javascript and is on every page.

I'm not sure how putting the Google Referral Code in there would work - I don't want the Referral code on every page - I want it to be visible on SOME pages, when and where I choose.  Surely there is a way to make these Google referral buttons appear?

In regard to the UDT, the wiki post mentioned above does not state anywhere that the UDT is for PHP.  Seems to be conflicting information in different wiki posts, so it can take quite a long time to find out exactly what can and can't be done. 

Hope someone can help further with the Google Referral Code,

Cheers
WebGirl
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How to add Google Referral code

Post by Dr.CSS »

What is the google referral code, what does it look like?...

Do they tell you how to add it to a page?...
cyberman

Re: How to add Google Referral code

Post by cyberman »

WebGirl wrote: I don't want the Referral code on every page - I want it to be visible on SOME pages, when and where I choose.
Nothing it's easier like that - create a special googlized template for these pages.
Post Reply

Return to “General Discussion”