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 Losing Session - Shop > Cart

mreeemreee Member
in Help edited August 2014
Hello there,

I am losing session between my shop and my cart page. This is where it starts:

Things I have checked:

1. I have foxycart.js on my shop page
2. I have checked tag with Google Tag Assistant
3. I have followed instructions from the Foxy wiki

Any other ideas why this would be happening?

  • fc_adamfc_adam FoxyCart Team

    How are you including foxycart.js? Is it using Google Tag Assistant? If so - you'll need to also set up the analytics code to be included that way as well. Currently the analytics code is running before foxycart.js is included and executed.
  • I was including it.. but noticed that when I add it, I can't click the add to cart button on one of my pages

    No error appears, it simply doesn't do anything so I removed the foxycart.js

    Now it seems that it's more than just a tracking issue. There is something conflicting with the foxycart.js file and my form.
  • fc_adamfc_adam FoxyCart Team

    Actually - are you including the Google tag manager on either of those pages? I don't see it included. One further issue I just noticed on your page, including the one from the FoxyCart includes, you have 3 copies of jQuery on your page. That will definitely be causing some issues too. Make sure you just have one, and it's included before any scripts that require it.
  • We are not using Google Tag Manager. I was using the Google Tag Assistant chrome extension to check that the tag was firing correctly.

    The big issue now is if I include foxy cart.js on The add to cart button does not work at all. Have you seen issues like this before?
  • Set up a page so you can see what I mean
  • fc_adamfc_adam FoxyCart Team

    Ah - sorry, I'd misread your initial post.

    So your example page there - you actually have two includes of jQuery on the page - and you're including the second version *after* the foxycart.js include. That second jQuery include is blowing away any events created in the FoxyCart javascript, so it just doesn't exist. Try removing the jQuery included in the FoxyCart code group and we can take another look then.
  • No worries!

    I removed the jQuery after the foxycart.js include. Still same issue as before. When I try to press Add To Cart, nothing happens. Looks like a conflict with foxycart.js and my form.
  • fc_adamfc_adam FoxyCart Team

    Wow. So this one had me extremely confused, and to be honest I'm still not sure why it caused what it did, but if you remove the "name" attribute for your submit input, it will work.
  • That is strange. Thanks for figuring that out. Now we are back to square one :)

    The tracking between to my cart is losing session in between. I have:

    1. jquery above foxycart.js
    2. foxycart.js above my analytics code
    3. correct analytics code from wiki on both shop and cart

    Any ideas?
  • fc_adamfc_adam FoxyCart Team

    If you watch the realtime tab in Google Analytics in one window, and go through the checkout flow in another window - at what point do you see a new session being created? The cart looks correct to me, and I see the GA client ID present in the JSON
  • What I do is use URL builder to have source and medium of "test" and "test1". Then I filter my real time data to only show sessions that have a source/medium of test/test1.

    I lose the source/medium once I get to /cart so I am assuming that the session is lost.
  • fc_adamfc_adam FoxyCart Team
    edited August 2014

    Have you completed a transaction since getting the form to work to see if the source is there at the end?

    Also, if you don't filter the real time tab - do you actually see a brand new session starting when you get to the cart?
Sign In or Register to comment.