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.

Ecommerce Analytics


Awhile ago I turned on Google Analytics in the configuration section and entered our tracking ID. Everything with analytics and ecommerce tracking began working as expected.

Shortly after, there was an issue noticed where all of the custom registration fields we use when a Rescue School Class is added to the cart did not flow through to the receipt. They started getting lost somewhere after "place order" was clicked.

I know this sounds completely unrelated, but as soon as I unchecked the Google Analytics box in the config section, the registration fields began working normally again.

Could this be a JS issue somehow?

Any ideas would be appreciated! I'd really like to get back to tracking ecommerce data and I am at a loss.

I'll whisper more info separately.

  • fc_adamfc_adam FoxyCart Team

    Thanks for whispering a page to test with. Could you confirm for me please which custom fields weren't passing exactly when you had the analytics integration enabled?
  • Hi Adam,

    Sure. If you select "Enroll Now" on one of the courses and then proceed with checkout, you'll see #2 Rescue School Registration. None of those fields were passing through with analytics enabled.

  • fc_adamfc_adam FoxyCart Team

    Sorry for the delay in responding. I think this actually relates to how you're adding in the custom fields there, that you're adding them with javascript. When the checkout is re-rendered, the fields added by javascript will be lost completely - which results in those fields not being submitted with the page.

    If you want to see this in action - open your browsers console when on the checkout and execute FC.checkout.render().

    To fix this, you need to handle adding those fields with Twig instead of javascript. Looking over your javascript quickly, all of that should be possible with twig - for the most part it's just looping over the products to see if certain aspects are there, which you do like this:
    {% for item in items %}
    {% if item.category == "school" %}
    {# Do something #}
    {% endif %}
    {% endfor %}
Sign In or Register to comment.