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.

Google Analytics (Universal) Ecommerce Tracking Multiple Sessions

chubbard216chubbard216 Member
in Help edited March 2014
I followed the tutorial (found here https://wiki.foxycart.com/integration/googleanalytics_universal) for setting up Google Analytics (Universal Analytics) Ecommerce Tracking.

Everything seems to be working properly, except for one thing:

When the user adds a product to their cart (thus leaving the primary website and moving to the foxycart 'cart') the real-time reporting in GA shows multiple sessions - one from the referring page and another for the /cart page. Another session is added when the user moves from the /cart to the /checkout page, and yet another from the /checkout to the /receipt page.

Any ideas what would be causing this?

I'm testing on a beta site (and a beta GA account). I'll whisper the URL if need be.

Thanks for the help!

Comments
  • fc_adamfc_adam FoxyCart Team
    @chubbard216,

    The set up should account for that - and in my testing it was tracking through as a single user. Could you whisper me your URL? I'll take a look and see if anything stands out - it should definitely be tracking a single user. My first thought (without seeing your site) is that the GA session ID isn't being added into the cart session correctly from your site, so as it doesn't exist there the cart and checkout are starting their own sessions.
  • bionik_donbionik_don Member
    edited March 2014
    @chubbard216 @fc_adam, I had the same issue. It was solved by simply moving the GA script from the before the </head> tag to before the </body> tag in our site template and everything worked as it should. Our tip-off was that in the console it showed a "fcc is undefined error". As soon as the GA script was moved the error went away.

    Side note: the "Copy the following and paste it above the closing </body> tag in the respective templates. This can be directly in your FoxyCart admin or (preferably) in a template on your server that you will load into FoxyCart via FoxyCart's template caching functionality" needs to be inclusive of ALL templates, including your site templates and not just the FoxyCart templates.
  • fc_adamfc_adam FoxyCart Team
    @w1nd0wl1ck3r,

    Yeah - that error would mean that the GA code was being included before the FoxyCart includes. You'd need to make sure that the FoxyCart javascript file is being included before the GA code, which moving to your </body> tag must have done.

    @chubbard216, {in response to whisper}

    The issue you're running into is you have an error in your javascript file that your GA code is included in. Specifically, you've left the <script> and </script> tags in there which isn't valid javascript, so it's breaking that file. If you remove those, everything should start working just fine!
Sign In or Register to comment.