Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Enhanced Ecommerce

Options
  • 05-02-2015 12:48pm
    #1
    Banned (with Prison Access) Posts: 311 ✭✭


    Hi, I am stuck, I have the tags and firing rules set in gmt, this is my thank you page code that I took from google, with their examples

    I have over 2000 products between the 2 sites, do I have to add individual details and SKU to each field? or is there an easier way and I am missing it?

    <html>
    <head>
    <title>Receipt for your clothing purchase from Acme Clothing</title>
    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push();
    _gaq.push();
    _gaq.push(['_addTrans',
    '1234', // transaction ID - required
    'Acme Clothing', // affiliation or store name
    '11.99', // total - required
    '1.29', // tax
    '5', // shipping
    'San Jose', // city
    'California', // state or province
    'USA' // country
    ]);


    _gaq.push(['_addItem',
    '1234', // transaction ID - required
    'DD44', // SKU/code - required
    'T-Shirt', // product name
    'Green Medium', // category or variation
    '11.99', // unit price - required
    '1' // quantity - required
    ]);
    _gaq.push(); //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>
    </head>
    <body>

    Thank you for your order. You will receive an email containing all your order details.

    </body>
    </html>


Comments

  • Registered Users Posts: 2,031 ✭✭✭colm_c


    Normally you use part of the application logic to populate the details on the confirmation page, you shouldn't be adding these manually...

    Loop through the products ordered and output the relevent part of the tag for each item

    [code]_gaq.push(


    What ecommerce platform are you using? or are you rolling your own? most platforms have a plugin for Google tracking that you can simply download, configure and enable.


  • Banned (with Prison Access) Posts: 311 ✭✭Silverbling


    Thanks, its to go on a yola and Ecwid site so I do not have access to the source code so was trying the tag manager as a work around but it is not working.

    The basic analytics works fine, the enhanced ecommerce is missing the add to cart steps


  • Registered Users Posts: 6,079 ✭✭✭Talisman


    The basic analytics works fine, the enhanced ecommerce is missing the add to cart steps
    Just checking - Have you enabled Ecommerce tracking in GA? https://support.google.com/analytics/answer/1009612


  • Banned (with Prison Access) Posts: 311 ✭✭Silverbling


    Hi

    I have enabled all of the settings, I have been on to the developers, they are going to add this to the source code


    / Called when a product is added to a shopping cart.
    function addToCart(product) {
    ga('ec:addProduct', {
    'id': product.id,
    'name': product.name,
    'category': product.category,
    'brand': product.brand,
    'variant': product.variant,
    'price': product.price,
    'quantity': product.qty
    });
    ga('ec:setAction', 'add');
    ga('send', 'event', 'UX', 'click', 'add to cart'); // Send data using
    an event.
    }"


Advertisement