The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Universal Analytics Ecommerce Tracking

I still can't get ecommerce tracking to keep the session alive when my user goes from my site to the Cart. I have double checked the instructions and also have the foxycart.js file on my page above the tracking script. Any ideas on this one? I can pm you the site.
Comments
  • fc_adamfc_adam FoxyCart Team
    @mreee,

    It looks like the clientId for Analytics isn't correctly being added to the JSON cart data. Could you try adding this to the custom code below the analytics include on your website? There are two other function calls to fcc.events within this block already:
    fcc.events.cart.ready.add(function(e, arr) {
    if (typeof ga === 'function') {
    ga(function(tracker) {
    var clientId = escape(tracker.get('clientId'));
    if (typeof(FC.json.custom_fields['ga']) !== 'undefined' && FC.json.custom_fields['ga'].value == clientId) {

    } else {
    jQuery.getJSON('https://'+storedomain+'/cart?'+fcc.session_get()+'h:_fcpm=&h:ga=' + clientId + '&output=json&callback=?', function(cart) {
    FC.json = cart;
    });
    }
    });
    }
    return true;
    });
    Instead of adding the clientId as part of an add to cart, it will add it when the page is loaded. Note that that block of code only needs to be on your website - not on the FoxyCart templates.
Sign In or Register to comment.