Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Google Analytics stopped tracking e-commerce transactions
Tagged: Google Analytics, tracking
- This topic has 7 replies, 2 voices, and was last updated 13 years, 3 months ago by gamehermit.
-
AuthorPosts
-
August 17, 2011 at 3:08 pm #4089gamehermitMember
Hi,
I just noticed that my Google Analytics account stopped tracking the sales from my siet. It was working July when I was testing but for some reason the sales from the past few weeks have not registered.
E-commerce is enabled in GA. I have the following code on my “Thank You” page: [wp_eStore_transaction_result:end] and the PayPal return URL and download links on the “Thank You” page work great. Here’s the link to the “Thank You” page: http://www.pumpkinlady.com/thank-you/
I have also verified that the PDT Identity Token has been set correctly and the “Enable Google Analytics Tracking” has ben enabled in the 3rd Party Integration section.
I just ran a test transaction…here is the view source for Google Analytics for this transaction:
Code:<script type=”text/javascript”>//<![CDATA[
// Google Analytics for WordPress by Yoast v4.1.3 | http://yoast.com/wordpress/google-analytics/
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’,’UA-412406-1′]);
_gaq.push([‘_trackPageview’],[‘_trackPageLoadTime’],[‘_addTrans’,’1M303855EU897523A’,’The Pumpkin Lady’,’0.01′,’0.00′,’0.00′,’Powhatan’,’VA’,’United States’],[‘_addItem’,’1M303855EU897523A’,’547′,’Humdrum Dragon’,”,’0.01′,’1′],[‘_trackTrans’]);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
//]]></script>I’m using the Google Analytics for WordPress plugin Version 4.1.3.
Am I doing something wrong or is there a better way to make this work?
Thanks so much,
Jack
August 18, 2011 at 1:51 am #35602adminKeymasterI use “Google Analytics for WordPress plugin Version 4.1.3” and it works fine because I am using it myself. Also, the code to track the transaction is there too so I don’t see why it wouldn’t track the transaction. Are you sure this above transaction did not show up in your analytics account?
Are you using a caching plugin?
August 18, 2011 at 4:53 pm #35603gamehermitMemberI am using W3 Total Cache…and I’m going through CloudFlare…is there settings I need to change with either of these?
I have the following entries in the Page Cache Section:
Rejected Cookies:
ap_id
cart_in_use
eMember_in_use
Cache Exception List:
wp-comments-popup.php
wp-links-opml.php
wp-locations.php
Thanks,
Jack
August 19, 2011 at 1:05 am #35604adminKeymasterYour setup looks fine… the following should do the job:
Rejected Cookies:
ap_id
cart_in_use
eMember_in_use
WP eStore is only responsible to add the following tracking code to the analytics tracking plugin which it is doing fine after the transaction. Beyond that I don’t really have any way of knowing what else could be interfering with the tracking (I really have no way of troubleshooting external analytics account related issues):
['_addTrans','1M303855EU897523A','The Pumpkin Lady','0.01','0.00','0.00','Powhatan','VA','United States'],['_addItem','1M303855EU897523A','547','Humdrum Dragon','','0.01','1'],['_trackTrans'];
August 19, 2011 at 2:04 am #35605gamehermitMemberI just received a reply from CloudFlare…I think the problem may have been there. I had CSS minify turned on through their service. They suggested disabling that and seing if that fixes the issue. They also have a feature called “Website Pre-loader” which may be the culprit as well. I will keep you informed when I discover which is the culprit.
This is becoming a REALLY popular service but they are going to have to address these issues in the future if they indeed causing the issue…which I believe they are. This way if any other eStore customers experience the same thing then hopefully this post will help
Thanks for looking verifying that I had the right settings in place.
Jack
August 19, 2011 at 2:34 am #35606gamehermitMemberOk…just ran a transaction through with the CloudFlare CSS Minification disabled (so CloudFlare is doing no Minification now). If the sale gets reported to GA then we know that that was the culprit. If it doesn’t show up then it’s more than likely the “Website Pre-loader” on CloudFlare.
Everything from the cart looks fine…the Thank You page, the code from the view source (see below), etc… So I’m certain that it has nothing to do with the cart or the W3 Total Cache.
I found out that a lot of web hosts (I use HostGator.com) have made CloudFlare available by simply letting the user enable it in CPANEL. CloudFlare is fantastic but I’m hoping that I can find out what settings to look out for when using it and trying to track sales at the same time.
Code:<script type=”text/javascript”>//<![CDATA[
// Google Analytics for WordPress by Yoast v4.1.3 | http://yoast.com/wordpress/google-analytics/
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’,’UA-412406-1′]);
_gaq.push([‘_trackPageview’],[‘_trackPageLoadTime’],[‘_addTrans’,’36B90383MJ366861M’,’The Pumpkin Lady’,’0.01′,’0.00′,’0.00′,’Powhatan’,’VA’,’United States’],[‘_addItem’,’36B90383MJ366861M’,’570′,’Snap’,”,’0.01′,’1′],[‘_trackTrans’]);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
//]]></script>Jack
August 19, 2011 at 3:37 am #35607adminKeymasterI would first disable cloudflare totally and do a test transaction and see if the tracking works fine. That should prove if the issue is indeed coming from cloudflare. Then you can look into the specific section of cloudflare to see which options is introducing the issue. Just remember that you need to give it some time for it show up in your analytic account (the tracking is not real time)
August 19, 2011 at 12:31 pm #35608gamehermitMemberCool….figured out that it was indeed CloudFlare!
The problem was being caused by having the CSS Minify setting enabled in the CloudFlare settings. To test this I disabled the CSS Minify and emptied the CloudFlare cache…(all the other settings in CloudFlare were left at the default). Next I ran a test transaction. When I checked Google Analytics this morning, the transaction was there
So if anyone is having trouble with sales tracking in GA, and is using CloudFlare..try disabling the CSS Minify settings and see if the problem goes away.
Hope this is helpful
Jack
-
AuthorPosts
- You must be logged in to reply to this topic.