Ubercart is not sending many details to Google Analytics

Posts: 62
Joined: 08/31/2007
Bug Finder

Hello Everybody

Ubercart is not sending many details to Google Analytics such as

Revenue, Transaction, E-Commerce conversation rate etc.
Currently ubercart is sending only who visited the cart i think.

Posts: 5379
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Assuming you have enabled the Google Analytics for Ubercart module, can you look at the HTML for the footer of your checkout completion page? Let me know if the JS for e-commerce tracking is getting in there... it should be a form with an order's product details and such.

Also, I was checking out the code the other day and realized that payment methods that don't end up requiring or letting the customer go to the completion page may skew the data. This makes it essential for us to get some reporting into core. (Well, we knew that anyways. Eye-wink)

Posts: 62
Joined: 08/31/2007
Bug Finder

Seems the fix yet didn't make into the 7e release. Sad
There is no such ubercart related js in footer.

Posts: 50
Joined: 08/08/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik

It's working for us.
Just upgraded one of our stores to the 7e release.

Have you enabled both Googla Analytics and the Analytics for Ubercart?
And is the Google Analytics ID correct?

--

Erlend Strømsvik
Ny Media AS
erlend@nymedia.no

Posts: 62
Joined: 08/31/2007
Bug Finder

Hi quaoar

Thank you for taking time to reply to this thread.
I am pleased to hear that it is working well for you.
It greatly encourages me to take a deeper look on the issue in my setup again.

I have installed/enabled 5.x-1.3 version of Google Analytics.
I have enabled Ubercart Google Analytics module too.
Site performance reporting works and i hope that also answer's correctness of Google Analytics ID.

Are you getting the following details such as Revenue, Transaction, E-Commerce conversation rate etc in Google Analytics?
Can you let me know in which page in Google Analytics ubercart reports the e-commerce performance to?

Posts: 50
Joined: 08/08/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik

The transaction data is output when the user reaches this page:
cart/checkout/complete

--

Erlend Strømsvik
Ny Media AS
erlend@nymedia.no

Posts: 62
Joined: 08/31/2007
Bug Finder

The problem in our end is we are using a custom checkout completion page

Posts: 50
Joined: 08/08/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik

It's fairly simple to change or add another "order completed" page to the GA Commerce tracking.
Just open the uc_googleanalytics.module and find the function "uc_googleanalytics_footer".
Then substitute the "if(arg(0) == 'cart' && arg(1) == 'checkout' && arg(2) == 'complete')" with whatever page (url) you have as custom order completed page. Or you could add another if/elseif.

--

Erlend Strømsvik
Ny Media AS
erlend@nymedia.no

Posts: 62
Joined: 08/31/2007
Bug Finder

Hi Erlend Strømsvik

as you suggested i changed the checkout completion page url from "complete" to "thankyou" as seen in the following code snippet.

if((arg(0) == 'cart' && arg(1) == 'checkout' && arg(2) == 'thankyou') ||
      !empty($checkout_page) && $checkout_page == $_GET['q']){

But still no change.

There is no ubercart google analytics specific js added to the footer.

Posts: 62
Joined: 08/31/2007
Bug Finder

Hi Ryan and Erlend Strømsvik

Finally i fixed the issue,
I just copy-pasted the text content from my custom checkout completion page called "thankyou" to ubercart's default check out completion page.

Now everything working well,

Thanks a lot for your help

Posts: 27
Joined: 04/12/2008

According to this post: http://drupal.org/node/179977

Quote:
Note: This feature is currently limited to urchin.js (May 2008)

I'm reading this to mean that you need to enable the setting "legacy mode" if using the Drupal Google Analytics module, rather than the newstyle code?

Have just switched the setting (admin/settings/googleanalytics) and will try to report back once we've had some sales roll into G.A.

OT: Btw, I've just discovered the excellent Piwik - www.piwik.org - quite impressed with this OSS alternative to Google Analytics.

--

Giant Robot - for campaign, charity, ngo & online store solutions
http://www.giantrobot.co.nz/