Zen Cart Logo
Forums / General Questions / Google Analytics and goal tracking

Google Analytics and goal tracking

Locked

Views: 4,914

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
20 Jul 2010, 2:17 PM
#1
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Google Analytics and goal tracking

I have looked around the forum and add-ons and seen
scripts which add google analytics tracking to zencart.

I am not looking to add any further add-ons to the current
setup I have, but would like to know if add the google
tracking code to the checkout_success page under
define_page editor.
Then setup a goal to record everytime the
checkout_sucess page is displayed, that it will track the number of
sales.

I believe the checkout success url should be:
index.php?main_page=checkout_sucess

20 Jul 2010, 2:25 PM
#2
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,288
Plugin Contributions:
39

Re: Google Analytics and goal tracking

No it cannot be added in your defined pages editor.

~Melanie

20 Jul 2010, 2:36 PM
#3
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: Google Analytics and goal tracking

Is there a reason why this would not work?

20 Jul 2010, 2:50 PM
#4
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,288
Plugin Contributions:
39

Re: Google Analytics and goal tracking

Yes, the tracking needs to be in a specific location.... the body, just before the closing body tag.

The defined text is not in the correct location.

You may get results, but they will not be reliable

~Melanie

20 Jul 2010, 3:12 PM
#5
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: Google Analytics and goal tracking

According to google it should go before the closing </head> tag though I have seen other sites place it at the bottom of the
page before the closing body tags as you have said.
It seems to me it won't matter where it is as long as its picked up and sends data back to google (I may be wrong on that though). Which I would expect it to do
if its only appears on the checkout_succes page which would load completely after customers purchase.

I have put it in to see how it goes, aslong as it does not interfere with the shopping cart checkout functionality then I will try it to see what happens.
Seemed to be ok when I put through a test purchase. I can always delete the goal if does not workout as expected.

20 Jul 2010, 5:58 PM
#6
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

Re: Google Analytics and goal tracking

neit:

According to google it should go before the closing </head> tag though I have seen other sites place it at the bottom of the
page before the closing body tags as you have said.
It seems to me it won't matter where it is as long as its picked up and sends data back to google (I may be wrong on that though). Which I would expect it to do
if its only appears on the checkout_succes page which would load completely after customers purchase.

I have put it in to see how it goes, aslong as it does not interfere with the shopping cart checkout functionality then I will try it to see what happens.
Seemed to be ok when I put through a test purchase. I can always delete the goal if does not workout as expected.

Used to be you put it on the bottom of your page so as not to slow down the rendering of the page as the javascript loads. However the new code Google uses loads the javascript asynchronously so this isn't a problem.

Best place to put it is probably in includes/templates/YOUR_TEMPLATE/common/tpl_header.php or tpl_main_page.php whichever floats your boat.

I don't see any reason why you would ONLY track the checkout_success page. Track everything.. then you can drill down to which hits were on what page.

After you get basic analytics working then work on getting a goal funnel for your e-commerce conversions.

You might want to look into the google analytics modules anyway. The one I'm using was actually quite simple. And it was easier to manage then my previous code hacks.

21 Jul 2010, 2:05 AM
#7
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Google Analytics and goal tracking

Hi neit
Did you end up installing this into your template header? What are the results, any feedback?

21 Jul 2010, 2:32 AM
#8
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Google Analytics and goal tracking

llynix:

Used to be you put it on the bottom of your page so as not to slow down the rendering of the page as the javascript loads. However the new code Google uses loads the javascript asynchronously so this isn't a problem.

Best place to put it is probably in includes/templates/YOUR_TEMPLATE/common/tpl_header.php or tpl_main_page.php whichever floats your boat.

I don't see any reason why you would ONLY track the checkout_success page. Track everything.. then you can drill down to which hits were on what page.

After you get basic analytics working then work on getting a goal funnel for your e-commerce conversions.

You might want to look into the google analytics modules anyway. The one I'm using was actually quite simple. And it was easier to manage then my previous code hacks.

Adding the pixel here will actually place it after the </head>, I'm just trying to find out where I can place it so it appears before the </head>

21 Jul 2010, 2:34 AM
#9
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Google Analytics and goal tracking

Best solution is to download the Google Analytic by Andrew. Simple to install and would work with Ecommerce Conversion.

Other than that good luck getting the conversion rate working.

21 Jul 2010, 2:52 AM
#10
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Google Analytics and goal tracking

Hmmm,
not sure why you're saying that?
anyhow the file to paste your pixel into is includes/templates/my-template/common/html_header.php
I will keep you posted if this all works.
The issue with Andrew's contribution is I think that it places the pixel before end of the body with is the old way Goole recommended.

21 Jul 2010, 3:02 AM
#11
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Google Analytics and goal tracking

I just posted what works, your free to experiment with other ways. Last time I checked the snippet Google Provide doesn't provide Conversion Rate otherwise there will be no need to install any mods.

That is if you care for CR. Otherwise you can post it in the html_header.php

21 Jul 2010, 7:41 AM
#12
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: Google Analytics and goal tracking

Yes putting the code in the define checkout_success page worked, although it does appear within the body, as expected.
As it should have indicated 2 sales 1 test one from me and a legitimate one.
These both show up as goal conversions.
I could go down the lin goal funneling to see where customers may not complete sales, I just ahve not looked into that yet.

I have just belooking at html_header.php in the templates
folder and I already had the code added so I don't know
if the goal tracking is showing up as a result of that.

I will remove from the define_checkout_success page to see.

23 Jul 2010, 8:39 AM
#13
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: Google Analytics and goal tracking

Still seems to working ok.
So will look into the funnelling.

24 Jul 2010, 2:21 AM
#14
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Google Analytics and goal tracking

Wondering if you have the conversion rate working or the just how many orders you are getting.

Conversion Rate is completely different than Goals.

2 Aug 2010, 7:48 AM
#15
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: Google Analytics and goal tracking

at the moment I have setup to track just the number of orders.