google analytics and the shopping cart

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Phasm
New Member
New Member
Posts: 9
Joined: Sun Jul 19, 2009 6:18 pm

google analytics and the shopping cart

Post by Phasm »

I wish to track the conversions from my client's google analytics campaign to purchases with our client's products (both 5lb and 10lb sizes).

Google gave me this code to insert into their website that will embed cookies and tracks conversions. It's javascript.

However I'm not really sure where to place the code. I've been digging through the cart module but can't find a place to put it.

Any help / suggestions would be greatly appreciated.

Thank you.
kendo451

How to use Google Analytics with CMS Made Simple

Post by kendo451 »

Do this:

1. With Content->Global_Content_Blocks create a new global content block called "analytics" with this inside:

Code: Select all

{literal}
<!--- paste the google analytics code here -->
{/literal}
Don't forget the {literal}{/literal} tag or it will not work!

2. In all of your page templates, put this line at the very end, right before

Code: Select all

{global_content name='analytics'}
3. In Google analytics you can set up your "funnel" to measure the various pages in your checkout chain.  Just go through the buying process once and note the URL of each page.  Then put the page URLs in Google Analytics as a "Goal" to measure your conversions and see how people go through your sales "funnel".

Hope this is helpful. Don't forget to modify the title of this post to [solved].

Ken
Phasm
New Member
New Member
Posts: 9
Joined: Sun Jul 19, 2009 6:18 pm

Re: google analytics and the shopping cart

Post by Phasm »

Ken,

Thank you for your help!!! I will give this a try and when I get the report that it all works, I will edit the title.
Phasm
New Member
New Member
Posts: 9
Joined: Sun Jul 19, 2009 6:18 pm

Re: google analytics and the shopping cart

Post by Phasm »

What file would I be creating this new content block in? and I can't find the template files for the shopping cart. All that I can find is the template_c folder and with my past experience with smarty I'm pretty sure that's all temporary.

any more info would be greatly appreciated!!
kendo451

Re: google analytics and the shopping cart

Post by kendo451 »

You don't put it in a file, you put it in the page template.

Log into yoursite.com/admin

Click Layout->Templates

Look in the page template near the very end and insert {global_content name='analytics'} just before

(That is of course, assuming you followed my advice and created a global content block named "analytics" and put your GA code in there between {literal} and {/literal} tags.
Phasm
New Member
New Member
Posts: 9
Joined: Sun Jul 19, 2009 6:18 pm

Re: google analytics and the shopping cart

Post by Phasm »

ahh okay, then the final question would be, where do i create a global content block named "analytics"

is that in the admin panel as well?
kendo451

Re: google analytics and the shopping cart

Post by kendo451 »

It sounds like you haven't looked at the very basics of CMSMS.

Log in to the admin area

Under "Content" find "Global Content Blocks"

create a new one.

Paste your Google Analytics Code in there.

Before the beginning of the code put {literal}

at the end of the code put {/literal}

Then name it analytics and click submit.
Phasm
New Member
New Member
Posts: 9
Joined: Sun Jul 19, 2009 6:18 pm

Re: google analytics and the shopping cart

Post by Phasm »

Yeah, sorry about that. This is a one time thing. after this change and a few months of development there wont be any more cmsms so I won't have to worry about it :)

I will be performing this tomorrow and will report on how it all goes. Thank you Ken for your time! It's truly appreciated.
Post Reply

Return to “Developers Discussion”