1

I need to get views of particular item by it's id from goggle analytics reporting api, google analytics code on the site looks like that:

        // Called when a link to a product is clicked.
    function onProductClick241() {
        ga('ec:addProduct', {
            'id': '241',
            'name': 'Туфли',
            'category': 'Туфли Весна - Осень 2016',
            'brand': 'Bertoli',
            'position': 17,
        });
        ga('ec:setAction', 'click', {list: 'Category List'});

        // Send click with an event, then send user to product page.
        ga('send', 'event', 'UX', 'click', 'Results', {
            hitCallback: function() {
                document.location = '/shoes/tufli/241-bertoli';
            }
        });

How can I do that?

  • It appears that the code above is from the search results page. Could you also share the Analytics snippet from the actual product page? – dorian Mar 24 '16 at 13:43
  • Are looking for the appropriate field names or do you need a complete tutorial on how to query the API (which might be out of scope for stackoverflow) ? – Eike Pierstorff Mar 24 '16 at 14:03
  • 1
    That code is from an actual product page, though it was not written by me, the id field is id of product on the site and I need to get views of the product by that id. – Ziyadin Shemsedinov Mar 24 '16 at 14:26

0 Answers0