0

I got 9 successful transaction but I can see only 2 in google analytics. I do redirect to https while I get payment that I doubt about it may cause but not really sure while e-commerce tracking doesn't work properly.

UPDATE:

var pageTracker = _gat._getTracker('UA-1234567890');
pageTracker._trackPageview();
pageTracker._addTrans('254','','217,4550','','0','İstanbul','','Turkey');
pageTracker._addItem('254','203','AAA - BBB','','169,00','1');
pageTracker._addItem('254','167','XXX - YYY','','59,90','1');
pageTracker._trackTrans(); 
5
  • Have you put the proper GA tracking code for all the actions on your site? Commented Feb 25, 2013 at 4:11
  • what do you mean all the actions? only one action has that's the completed order. also I have GA tracking code for all pages, Its in the master page.
    – Mert
    Commented Feb 25, 2013 at 7:23
  • 1
    Are you sure your e-commerce tracking code (separate code that goes only on the checkout-success page) is firing for every completed transaction? Or is it only firing on certain conditions that may not be met for every transaction? I also believe your order IDs will need to be unique each time. From your question, it would seem that the tracking code is working, it's just not working all the time. Also note that it does take some time for the data to show up in Google Analytics. Commented Feb 26, 2013 at 18:03
  • I just added sample e-commerce tracking code on checkout-success, yes the problem seems not working all time. and yes I do add tracking code in all conditions. probably I won't see this sample trans in google anlytics..
    – Mert
    Commented Feb 26, 2013 at 19:20
  • We are using a A URL to track the sales? The simplest way is to add Goal URL, The URL which appears after completion of sale process. You can try that as well.
    – user2434
    Commented Oct 3, 2013 at 10:07

1 Answer 1

2

The example you gave is incorrect and you need to check your implementation, since your addTrans and addItems do not match up.

This is how it should look like:

var pageTracker = _gat._getTracker('UA-1234567890');
pageTracker._trackPageview();
pageTracker._addTrans('254','','228,90','','0','İstanbul','','Turkey');
pageTracker._addItem('254','203','AAA - BBB','','169,00','1');
pageTracker._addItem('254','167','XXX - YYY','','59,90','1');
pageTracker._trackTrans();

So what's different? Your addTrans needs to be populated with the TOTAL price of all addItems. You have 169,00 + 59,90, each with a quantity of 1. That translates to 228,90 and not 217,4550 in your example. Since the total sum breaks, no transaction is recorded.

2
  • The diffrence caused by %5 cash discount. what should I do in discount cases
    – Mert
    Commented Oct 3, 2013 at 10:26
  • Found this question again due to the upvote. Although this question is already ages old, you need to substract the 5% discount from the items (addItem) which have the discounts, thus the final amount (addTrans) is correct.
    – David K.
    Commented Feb 6, 2015 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.