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.

Custom Google Analytics Integration

alanalan Member
We recently hired a new advertising firm that wants us to change our analytics code. Specifically they want us to start tracking Client IDs. Does FC Google Analytics already track this variable? Per their instructions, I had this function called from our website

ga(function(tracker) {
var dimensionValue = tracker.get('clientId');
ga('set', 'dimension1', dimensionValue);

where dimension1 is specified in analytics as the Client ID. This seems to have worked for most pageviews on our site.

For our FoxyCart checkout page, I left the analytics configuration alone. According their analysis, this led to only ~30% of users visiting our checkout page to have their Client IDs correctly tracked.

I'm thinking that I will need to do a custom integration of google analytic into our FoxyCart pages to get these Client IDs tracked correctly with 'dimension1' as above. Is their a guide on doing custom integrations of analytics with FC's checkout and receipt pages? Specifically, I'm asking for the FC parameters that need to be parsed in our custom footer code that will make sure that transactions and revenue are accurately recorded. Can you provide the templates you use for Google analytics integration into the checkout and first_receipt pages?


  • brettbrett FoxyCart Team
    Hi @alan. We'll take a look and get back to you soon with some info.
  • fc_adamfc_adam FoxyCart Team

    Thanks for posting - that's a good question. We do track the clientId as part of our own integration, we use that to be able to identify a customers single analytics session between your website and the checkout which could be on a different domain. In your case, as you have a custom subdomain for your store, that's not actually required, so customers are tracked through regardless.

    With how our current native Analytics integration works - it doesn't support adding in custom GA calls prior to the pageview tracking call is run. That does mean that if you're wanting to add custom dimensions to the cart, checkout and receipt as well as on your own site - that will require a custom set up.

    We don't have a guide currently for setting that up - but I can whisper you our current code for you to reference if you're wanting to go the custom route. I'll follow up with that shortly.
Sign In or Register to comment.