AdWords
2.8K members online now
2.8K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Analyitics Ecommerce Tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello Guys

 

I have been trying to sort out ecommerce tracking on my analyitics profile but I cannot get it to work.

 

I have set the profile to Ecommerce yes, I can access the page that displays the sales but none of the sales or test I have performed have tracked at all.  - I have copied the code from a test transaction below. Another thing, most of my website is http:// so I have set this in the profile settings but where this information is sent it si https:// - would this make a difference?

 

<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', UA-{MYCODE}-1]);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'10177', // transaction ID - required
'MY Shop', // affiliation or store name
'21.24', // total - required
'0.00', // tax
'3.99', // shipping
'cityn', // city
'cc', // state or province
'United Kingdom' // country
]);


_gaq.push(['_addItem',
'10177', // transaction ID - required
'R7889', // SKU/code - required
'My Product', // product name
'PRODUCT CAT', // category or variation
'21.24', // unit price - required
'1' // quantity - required
]);

_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers

(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>

 

Any help will be much appreciated.

 

thanks

adam

2 Expert replyverified_user

Re: Analyitics Ecommerce Tracking

Top Contributor
# 2
Top Contributor

Hi Adam,

 

I am not sure if you have reviewed this Google Developers document explaining each and every field present in this tracking and how to implement it: 

 

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

 

If you are a programmer, then it shouldn't be an issue for you to understand this, otherwise my suggestion would be consult a web developer or a programmer for the implementation of this script.

 

Pankaj

Re: Analyitics Ecommerce Tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

I have been using https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce to set up the tracking and believe I have followed it perfectly. 

 

Is this not the correct documentation?

 

Thanks

Adam

Re: Analyitics Ecommerce Tracking

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
I have been using https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce to set up the tracking and believe I have followed it perfectly.

Is this not the correct documentation?

Thanks
Adam

Re: Analyitics Ecommerce Tracking

Top Contributor
# 5
Top Contributor
Hi adam,

I don't think it's the protocol. The script properly detects the page protocol and issue the request for ga.js with the same protocol as the page.

I don't see anything obviously wrong with the code. Have you checked the page with a debugger like Firebug to see if you have Javascript errors on the page, either in this block or in other script blocks on the page? Sometimes, errors in script blocks preceding the Analytics block can prevent the Analytics code from running.

Ok, I take that back. I pasted your code into an html doc locally to see if it throws an error. I didn't even get that far. You account id is not enclosed in quotes. Javascript will interpret that as a variable name minus a value. Since there is no variable named UA, the script stops function at that point. If this is your exact code (except for obscuring your account id, place quotes (single or double) around that value and the script should begin working.

Please let us know if this solves the problem. If not, I'll take another look at this.

Best of Luck,

Pete
petebardo -- Deadhead doing AdWords