Community Forums

Google Analytics Ecommerce Tracking

Free manual modifications can be contributed here. Modifications are manual snippets of code that are pasted into the forums for others to use.

Re: Google Analytics Ecommerce Tracking

Postby stonehinged » Tue May 08, 2012 11:46 pm

I can confirm addOrder($data) is in my version, which is 1.5.2.1.

I've looked at my Google account in analytics and no conversions reported for the 5 or 6 test orders I placed. Wouldn't have anything to do with C.O.D. paymethod would it? I did not try a PayPal order but will. I'll try to see if I can see if I can spot anything in Firebug.

Any other possible ideas?
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
User avatar
stonehinged
 
Posts: 113
Joined: Wed Aug 18, 2010 1:10 am
Location: US

Re: Google Analytics Ecommerce Tracking

Postby moneycarlo » Wed May 09, 2012 12:13 am

payment method shouldn't matter, i dont think as long as your getting to the success page. I just tried a COD and it worked for me.
are you using default template, or have edited the xml for your template path? Have google analytics enabled in your admin panel? have "E-Commerce Tracking" turned on in your Google Analytics account?

Otherwise in chrome or ie you should be able to open the dev tools and review what the javascript is sending.
moneycarlo
 
Posts: 151
Joined: Tue Sep 27, 2011 7:40 pm

Re: Google Analytics Ecommerce Tracking

Postby stonehinged » Wed May 09, 2012 1:38 am

Yeah, the first thing I did was to see if I could see the variables in Developer Tools (and I can). But still nothing in my Google Analytics account. It's now been long enough to register.

Using default template, no edits to the path. GA enabled in admin and E-Com tracking turned on in the GA account.

Odd thing is that when I tested a week or two back w/o shipping and tax variables I was seeing variables in page source and seeing conversions in GA.

Sure wish I could get this last bit figured out! Thanks for your replies and tries moneycarlo! I trust you've actually seen conversions in your GA account with this vQmod?
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
User avatar
stonehinged
 
Posts: 113
Joined: Wed Aug 18, 2010 1:10 am
Location: US

Re: Google Analytics Ecommerce Tracking

Postby stonehinged » Wed May 09, 2012 2:50 pm

OK, I think I may have narrowed this down to an issue with coupons. I finally saw one order come through analytics last night and it might have been the ONLY order I did test w/o a coupon. Has anyone else seen issues with coupon entries causing issues with reporting in Google Analytics?

Moneycarlo, if you haven't, can you try your vQmod and order with a coupon and confirm the analytics reports the conversion?
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
User avatar
stonehinged
 
Posts: 113
Joined: Wed Aug 18, 2010 1:10 am
Location: US

Re: Google Analytics Ecommerce Tracking

Postby moneycarlo » Wed May 09, 2012 3:27 pm

i just tried a coupon and it worked fine. I'll try a few more things today and see if i notice anything. I was also told we're not seeing it in the source because somehow it's getting appended to the .js itself. Which doesn't help me much since im not really a programmer haha
I use chrome, and have dev tools open and on the success page, i go to scripts and select the "index.php?route=checkout/success" script from the drop down and i can still see all my tags and they show up in my GA.
moneycarlo
 
Posts: 151
Joined: Tue Sep 27, 2011 7:40 pm

Re: Google Analytics Ecommerce Tracking

Postby stonehinged » Wed May 09, 2012 4:15 pm

Thanks moneycarlo, I have verified the variables in Developer Tools and in Firebug, so I'm less concerned, especially since I got one conversion to register last night perfectly. But I've tested another w/o coupon code today and it's not in analytics yet (and it's been over an hour). It's very strange. I am testing on my localhost, but that's never seemed to make a difference before. I want to see these conversions come in consistently of course.

Let me know what you find, I'll do the same. Feel free to PM me.

Steve
STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/
User avatar
stonehinged
 
Posts: 113
Joined: Wed Aug 18, 2010 1:10 am
Location: US

Re: Google Analytics Ecommerce Tracking

Postby moneycarlo » Tue Jun 26, 2012 5:09 pm

Sorry, was out of country for a month.
to recap:
I updated to 1.5.2.2(r990) and added the missing fields like tax, shipping info etc.
I also changed the way the product price was being calculated. The numbers never came out correctly for my use and just seemed odd.
The old calculation was (i suspect they meant the price was supposed to be multiplied by the tax rate and not the actual tax?):
$product['price']+($product['price']*$product['tax']/100)

I changed it to:
$product['price']+$product['tax'];

Previously, it was giving errors if no tax or shipping was used. I have corrected that so it should work fine for all the scenarios i could think of.

Remember, i'm basically a glorified hack so i may not be too helpful in php/mysql troubleshooting but tried my best to make it work for everyone.
Good luck!
Attachments
vqmod_catalog_google_analytics_e-commerce.xml
(4.43 KiB) Downloaded 193 times
moneycarlo
 
Posts: 151
Joined: Tue Sep 27, 2011 7:40 pm

Re: Google Analytics Ecommerce Tracking

Postby designbuyers » Tue Jun 26, 2012 10:57 pm

How it possible to test it with opencart ?

Should I make fake order to see if it can track conversions or not ?
OpenCart :
The best Open Source Cart for eCommerce
User avatar
designbuyers
 
Posts: 150
Joined: Tue Nov 09, 2010 8:25 am

Re: Google Analytics Ecommerce Tracking

Postby sjiitb » Thu Jul 12, 2012 8:21 pm

Hi
I want to thank justinv from the bottom of my heart for the awesome instructions!

Just a small doubt. To track normal page visits, I should include the standard google analytics code in the header right?
Won't this be double-counting the order success page?
sjiitb
 
Posts: 7
Joined: Sun May 20, 2012 12:51 pm

Re: Google Analytics Ecommerce Tracking

Postby designbuyers » Thu Jul 12, 2012 9:06 pm

moneycarlo wrote:Sorry, was out of country for a month.
to recap:
I updated to 1.5.2.2(r990) and added the missing fields like tax, shipping info etc.
I also changed the way the product price was being calculated. The numbers never came out correctly for my use and just seemed odd.
The old calculation was (i suspect they meant the price was supposed to be multiplied by the tax rate and not the actual tax?):
$product['price']+($product['price']*$product['tax']/100)

I changed it to:
$product['price']+$product['tax'];

Previously, it was giving errors if no tax or shipping was used. I have corrected that so it should work fine for all the scenarios i could think of.

Remember, i'm basically a glorified hack so i may not be too helpful in php/mysql troubleshooting but tried my best to make it work for everyone.
Good luck!


Why not submit it on extensions directory.
OpenCart :
The best Open Source Cart for eCommerce
User avatar
designbuyers
 
Posts: 150
Joined: Tue Nov 09, 2010 8:25 am

Re: Google Analytics Ecommerce Tracking

Postby JhauraW » Mon Jul 16, 2012 11:14 pm

UPDATE July 20, 2012: Fixed a bug in Product Name for some users.

I've made some fixes and improvements. This version confirmed working on 1.5.2.1

Mainly,

* Added $orderDetails['store_name'] for Affiliation instead of hard-coded

* I don't use product price + tax as Price in addItem because tax is shown in order total in addTrans

* $product['model'] for SKU instead of product database row id

* Hard coded 'Products' for category instead of $product['model'] which has nothing to do with category
Attachments
vqmod_catalog_google_analytics_e-commerce.xml
July 20 Updated Version
(3.94 KiB) Downloaded 216 times
Last edited by JhauraW on Fri Jul 20, 2012 7:42 pm, edited 3 times in total.
JhauraW
 
Posts: 19
Joined: Fri Mar 16, 2012 2:47 am

Re: Google Analytics Ecommerce Tracking

Postby 3antz » Mon Jul 16, 2012 11:25 pm

Hi JhauraW, do you know if this would work with 1.5.3.1 ? Thanks in advance
3antz
 
Posts: 140
Joined: Sun Oct 02, 2011 10:52 am

Re: Google Analytics Ecommerce Tracking

Postby JhauraW » Fri Jul 20, 2012 7:19 pm

Sorry haven't upgraded yet.
JhauraW
 
Posts: 19
Joined: Fri Mar 16, 2012 2:47 am

Re: Google Analytics Ecommerce Tracking

Postby designbuyers » Thu Aug 09, 2012 11:01 pm

JhauraW wrote:Sorry haven't upgraded yet.


You didn't upgrade your opencart to latest version ?
OpenCart :
The best Open Source Cart for eCommerce
User avatar
designbuyers
 
Posts: 150
Joined: Tue Nov 09, 2010 8:25 am

Re: Google Analytics Ecommerce Tracking

Postby storm-cloud » Tue Aug 28, 2012 3:52 pm

Just wondering if anyone has worked out how to include the product category variable?

I assume an extra database query needs to be included but I can't quite work this out...

Edit: JhauraW, I have just noticed that you removed the Google Analytics Account ID from the script. This is actually required for the tracking to work correctly.
storm-cloud
 
Posts: 159
Joined: Wed Feb 22, 2012 12:07 am

Re: Google Analytics Ecommerce Tracking

Postby promofire » Wed Oct 10, 2012 6:34 pm

Does this work with 1.5.4.1?
promofire
 
Posts: 149
Joined: Wed Jan 26, 2011 6:00 pm

Re: Google Analytics Ecommerce Tracking

Postby 1nkling » Sat Oct 13, 2012 7:37 pm

promofire wrote:Does this work with 1.5.4.1?


It would seem not.

With this vqmod engaged my customers are getting the error:

Fatal error: Call to undefined method ModelCheckoutOrder::getOrderProducts() in /home/mywebspace/public_html/vqmod/vqcache/vq2-catalog_controller_checkout_success.php on line 13

Seems the vqmod doesn't work with the latest version.. :'(

Tis a shame as I liked having my ecommerce tracking on analytics.
1nkling
 
Posts: 12
Joined: Sun Oct 23, 2011 1:54 pm

Re: Google Analytics Ecommerce Tracking

Postby philbydevil » Sun Oct 14, 2012 6:53 am

There's only a small change required... If out can't work it out I'll have a look at my xml file... probably won't be able to do it for a couple of days though.
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
philbydevil
 
Posts: 828
Joined: Thu Dec 02, 2010 9:20 pm
Location: Sunshine Coast, Australia

Re: Google Analytics Ecommerce Tracking

Postby 1nkling » Sun Oct 14, 2012 11:43 pm

philbydevil wrote:There's only a small change required... If out can't work it out I'll have a look at my xml file... probably won't be able to do it for a couple of days though.


Would be great if you can solve it. Thankyou! :)
1nkling
 
Posts: 12
Joined: Sun Oct 23, 2011 1:54 pm

Re: Google Analytics Ecommerce Tracking

Postby philbydevil » Mon Oct 15, 2012 8:18 am

Try this xml for 1.5.4.1:
vqmod-google-analytics-ecommerce-1541.xml
(4.15 KiB) Downloaded 167 times


You may have to change this line of code:
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">


The * may need to be changed to your theme name, but I think that * means ALL themes....
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
philbydevil
 
Posts: 828
Joined: Thu Dec 02, 2010 9:20 pm
Location: Sunshine Coast, Australia

PreviousNext

Return to Modifications

Who is online

Users browsing this forum: No registered users and 5 guests

Hosted by Arvixe Web Hosting