Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics: Page views tracked but not ecommerce transactions

I'm trying to figure out why the Ecommerce tracking in Google Analytics doesn't seem to work. I can see the page views correctly tracked but no transactions.

Snippet from the confirmation page:

<head>
<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
    _gaq.push(['_setDomainName', '.mydomain.com']);
    _gaq.push(['_trackPageview']);

    _gaq.push(['b._setAccount', 'UA-YYYYYYYY-1']);
    _gaq.push(['b._setDomainName', 'none']);
    _gaq.push(['b._addTrans',
                  '44bbd391-ff38-4f8d-ad68-aec490666151',
                  'Name',
                  '1.00',
                  '',
                  '',
                  '',
                  '',
                  ''
              ]);
    _gaq.push(['b._addItem',
                  '44bbd391-ff38-4f8d-ad68-aec490666151',
                  '15',
                  'test',
                  '',
                  '1.00',
                  '1'
              ]);
    _gaq.push(['b._trackTrans']);

    _gaq.push(['b._trackPageview']);
    (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>

...
</head>

I'm monitoring the traffic on the page with Firebug confirming that all pixel requests were made and came back OK.

I read about having to wait a few hours, up to one day, before you can see results in GA, but I can see the page views after only waiting a few minutes.

However, the transactions tracked using the same tracker object ("b") are not to be found anywhere(could the Ecommerce reports be refreshing slower than the page views?)

like image 794
CyberDude Avatar asked Mar 09 '11 15:03

CyberDude


People also ask

How accurate are Google Analytics page views?

Google Analytics is a reliable tool that gives accurate results in most cases. However, it's not 100% accurate because of some glitches and problems. The following are six common errors that may cause the data from GA not to be accurate and some suggestions for fixing them. Let's get started!

Does Google Analytics track page views?

Users, sessions and pageviews are among the key metrics Google Analytics provides, and they're very easy to find in your Google Analytics dashboard. Simply go to the Audience - Overview report. At the top is a line graph tracking users over time. You can toggle to see sessions and pageviews, among other metrics.

Can Google Analytics track ecommerce?

Ecommerce Tracking is a feature of Google Analytics that tracks shopping activity on your website. You can use it to track and analyze transaction data, revenue, products you've sold, and more. Ecommerce data in Google Analytics will give you specific insights into: Products with a high (or low) number of sales.

What data Cannot be tracked in Google Analytics?

You can't track Individual users Unfortunately, Google Analytics only allows to use a unique user ID and prohibits sending personal information, username or an IP address. So you can't really see and understand how specific users behave on your site and get valuable data.


1 Answers

And I finally found the issue. The answer is inconspicuously present on the GA docs page:

_trackTrans()

Sends both the transaction and item data to the Google Analytics server. This method should be called after _trackPageview(), and used in conjunction with the _addItem() and addTrans() methods.

It's rather easy to overlook but it has such a fundamental effect: transactions won't be tracked.

So yes, always call _trackTrans after _trackPageview!

like image 146
CyberDude Avatar answered Oct 17 '22 20:10

CyberDude