How to add GA tracking parameters to HMAC validated URL?

Guys,

I'm getting validation errors when adding GA tracking parameters to the end of the HMAC validated URL's.

image

Is there anyway to add GA tracking to HMAC URLS?

Comments
  • I also just stumbled upon this:

    image

    Are we not even going to be able to track direct to checkout purchases in GA?
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Great questions. Because of how our add to cart's currently work - it wouldn't work to include the GA parameters as part of the URL for a couple reasons. Firstly, because we do a server-side redirect for the URL to just a straight session URL - the URL parameters wouldn't actually be there when GA is initialised on the page. The parameters would also be considered a product parameter when included with an add to cart - which is why the cart is complaining there that they're not encrypted.

    In terms of a direct to checkout - if it's coming from your own website, it should still work fine. The issue is more related to if you're doing that from a source outside of your website, like from an email. Is that where your add to cart links are coming from?

    That said - I'll create a ticket to look into handling this natively as part of our application. We could whitelist those URL parameters, and include them as part of the redirected URL. I can't make any promises at this stage if or when we'll be able to get it added - but it'd be a worthwhile addition if we can make it happen.
  • @fc_adam,

    Yes, these are promotional links we use in email, social media, etc.

    And we like to use links that put the customer right into the cart to purchase. It would be great to track these.
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Thanks for confirming - we've got the enhancement ticketed, we'll try to get to it as soon as we can, thanks!
  • @fc_adam,

    I suppose we could add custom fields, and add some HMAC validated URL parameters with "medium" and "source" in the URL? And import these into analytics?
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    We've actually been able to get to this enhancement quickly - and I've just tested it out on Friday and it works great. We should hopefully have it merged in one of our first releases this week. We'll update you once it goes live.
  • @fc_adam,

    Ok cool. So this will allow source, medium, and campaign URL parameters to pass through to the redirected URL?

    Will it matter where they are placed in the original URL?
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    It'll whitelist the 5 UTM_* URL parameters that Google Analytics provides - and they can just be included in a normal add to cart as additional parameters, and they'll be included on the loaded page of that action, whether it's the cart or checkout.
  • @fc_adam, sounds good! I'll wait for you to confirm!
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    The change is now live - so you can now specify the UTM values as part of your external add to carts. It's pretty self-explanatory, but we've got it documented on our wiki at https://wiki.foxycart.com/v/2.0/cheat_sheet#transaction_non-product_specific_options. Thanks for requesting this!
  • Awesome. Thanks!
  • EpotratzEpotratz Member
    @fc_adam Any updates on getting GA tracking parameters working with SSO enabled stores?
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Thanks for reaching out - sorry for not posting sooner. We did push out a release last night which included the fix. You should now be able to use the UTM parameters with your store, and it will carry through the SSO process as well to the checkout. Thanks for your patience while we fixed up that for you!
Sign In or Register to comment.