Google Tag Manager

I've seen the issue discussed here: https://forum.foxycart.com/discussion/comment/54266
Is there a resolution for this yet? We are using GTM for a lot of tracking that we don't want to have to rewrite to use ga code directly inserted. Is it possible to use GTM on our website pages and then just use the universal code on the foxycart pages, checkout and receipt?
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    Unfortunately not - we do have ticket active to make some changes to allow for Google Tag Manager, but we haven't had a chance to work on that yet. For now you will need to include the Analytics code directly on our own website. The code will be automatically included for you on the cart, checkout and receipt pages when enabled in your store's configuration.
  • Ok, thanks. Anyway we can bump GTM integration up on the to do list?
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    I've added your details to the ticket to show that we have another user waiting on it. We'll update you as we have more information there.
  • Thanks!
  • Hi,
    Has there been any movement on the use of Google Tag Manager with FoxyCart?

    Thanks!
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    We do have a change pending in our QA queue, but it is quite complex to test so I'm not sure how long it will take to come through.

    That said, we do have a workaround for the interim - I'm sorry for not updating this thread with that information. Instead of using the Analytics tag that is provided by default with Google Tag Manager, create a “Custom HTML” tag, and paste into that the Tracking Code that you get from within Google Analytics directly. Also, if you include Google Tag Manager on your cart, checkout or receipt templates, ensure you don't include the Analytics tracking code on those pages - as we include it for you automatically.
  • fc_adamfc_adam FoxyCart Team
    A quick update on this thread - we've rolled out the change previously discussed so that the native Google Tag Manager Analytics integration is better supported. That said, we still recommend using the Custom HTML tag and pasting the normal Google Analytics tracking code in that way.
  • Hi, we've switched to GTM and are using the Custom HTML Tag for Universal Analytics, and excluding our foxycart pages from that Tag. We're having issues with Cross-domain tracking - seeing double transactions in Google Analytics. Is there a way to add the allow link to the ga create on the Receipt page?

    ga('create', 'UA-XXXXXX-X', 'auto', {
    'allowLinker': true
    });
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    The allowLinker GA set up won't actually work with FoxyCart - with how our add to carts work it doesn't work well. We handle the cross-domain requirements by manually setting the clientID in our GA initialisation code on the templates. Could you confirm the store this is for please so I can take a look at the calls?
  • It's our Oxfam Gifts store: oxfamgifts.foxycart.com
  • To note, this was working correctly prior to our adding in the GTM container
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    Thanks for that. Looking at your site - I'm just seeing the normal GA calls being made on the checkout and receipt - everything looks to be in order there. I am seeing two trackers being initialised on your own website though - you've definitely just got the one custom HTML tag for GA on your website?
  • Ahh, ok. Yes, it was being added through the FoxyShop plugin to non-FoxyCart-hosted pages, so we didn't need Universal Analytics at all through GTM, we just need GTM to handle event tracking.

    Thank you for your help!
  • We are still struggling with this. It appears like additional GA and GTM snippets are being added when the sidecart is invoked, so when a product is added to the cart and the #fc-sidecart is added to the url. Any idea why that might be happening? We are not using GA via GTM, the GA is separate, GTM is just for event tracking and 3rd party pixels.
  • fc_romanfc_roman Member, FoxyCart Team
    Hi @jingari,

    Sorry to hear about the continued trouble with GTM and GA.

    Let us look deeper into it and we'll get back to you.
  • Thanks, we've had to revert to just using regular universal analytics and no GTM because we couldn't resolve the tracking issue.
  • fc_romanfc_roman Member, FoxyCart Team
    @jingari,

    Thank you for the update.

    We'll let you know as soon as we've figured out the root of the conflict between GTM and UA/GA that you reported above.
  • thank you!
  • fc_adamfc_adam FoxyCart Team
    @jingari,

    Would there be any possibility that you could set up a hidden page with the code as you had it when it wasn't working still we could reference to see this issue in action?
  • Yes, I will try to get that set up.
  • EpotratzEpotratz Member
    edited December 2017
    @fc_adam,

    This developer describes how to use Google Tag Manager with foxycart. Would you advise using this method, or does GTM work natively with Foxycart now?

    Also, it appears that the issue related to seeing the receipt as a landing page in Google Analytics would be solved by listing your foxycart domain under your GA referral exclusions and also setting up cross-domain tracking between all your related domains.

    BTW, the cross-domain tracking seems to have been greatly simplified with the new gtag.js based Google Analytics, and cross-domain tracking is also supported through a Google Tag Manager implementation. Does Foxycart work with the new gtag.js for Google Analytics? (with or without GTM)?

    Thanks.
  • EpotratzEpotratz Member
    edited December 2017
    Just to clarify, GTM would not be used with the new gtag.js, as they are two independent products and gtag.js is sort of a mini-GTM. Since we're going to be implementing 3rd party tagging (e.g., Klaviyo) we'd like to stick with GTM. And I believe GTM still injects the analytics.js for UA/GA functionality.

  • fc_adamfc_adam FoxyCart Team
    @Epotratz,
    This developer describes how to use Google Tag Manager with foxycart. Would you advise using this method, or does GTM work natively with Foxycart now?
    You can use GTM with your own website no problems - but we don't fully support GTM's implementation of Google Analytics. Instead, we recommend using a custom tag with GA's normal initialization code pasted in, and then use our own analytics functionality to add support for GA on the cart/checkout/receipt.
    Also, it appears that the issue related to seeing the receipt as a landing page in Google Analytics would be solved by listing your foxycart domain under your GA referral exclusions and also setting up cross-domain tracking between all your related domains.
    You will indeed want to add in your FoxyCart store domain as a referral exclusion - that's part of the set up instructions for our set up. Our integration also takes care of cross-domain tracking, so there shouldn't be any problems there as long as it's all set up correctly.

    The issue on that other thread isn't related to those two things though, but more in how the native GA option within GTM is set up differently on the website than the standard GA initialisation code is.
    BTW, the cross-domain tracking seems to have been greatly simplified with the new gtag.js based Google Analytics, and cross-domain tracking is also supported through a Google Tag Manager implementation. Does Foxycart work with the new gtag.js for Google Analytics? (with or without GTM)?
    For what it's worth - we're using the client ID approach with the analytics.js implementation already for our cross-domain tracking. That said, we haven't done any testing at this point with the gtag.js approach - but I don't believe our integration would work with it currently.
  • @fc_adam,


    We do currently have the GA (analytics.js) integration working with Foxycart, but future items are being added to the transaction total, as seen here in the User Explorer report:

    image


    So we'd like to clean that up with a (custom) Google Tag Manager implementation of ecommerce tracking, and in general we'd like to follow best practices and manage all our tags with GTM.

    Does Foxycart support a data layer so we could implement the Google Tag Manager for standard ecommerce tracking? Any reason why we shouldn't do it this way?

    Thanks.




  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    We don't currently support GTM ourselves - so you wouldn't be able to use our native integration with GTM. That said, it should definitely be possible to set up your own custom integration and not use ours at all. All transactional information is available in the FC.json object for you to use for passing through to GTM/GA as required.
  • Ok, great. We'll probably be implementing that in Jan 2018!

    To disconnect from the native Foxy<>GA integration I assume the only thing we need to do is uncheck this box?


    image
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Yep, that's correct!
Sign In or Register to comment.