Add Google Tag recipe

Created on 14 November 2024, 3 months ago

Problem/Motivation

For users interested in tracking analytics on their websites the most common module used is Google Analytics and Google Tag Manager. There should be an easy way for them to add tracking capabilities using Google Tag using basic configuration for the module.

Proposed resolution

Add the Google Tag recipe to the Drupal CMS codebase.

✨ Feature request
Status

Active

Component

Track: Analytics

Created by

πŸ‡¨πŸ‡·Costa Rica dharizza

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @dharizza
  • Merge request !197Create basic Google Tag recipe. β†’ (Merged) created by dharizza
  • Pipeline finished with Failed
    3 months ago
    Total: 89s
    #338875
  • Pipeline finished with Failed
    3 months ago
    Total: 291s
    #338879
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Seems like a good start, but a few things jump out to me as being a little odd.

    This also needs test coverage; at minimum it has to have a ComponentValidationTest for idempotency. (There are examples in all the other recipes which you can take inspiration from.)

  • πŸ‡ΈπŸ‡°Slovakia poker10

    I know that the google_analytics module still does not have D11 compatibility fixed, but I am curious, what is the more common way to add tracking to the sites for ambitious marketers? Is it to use the GA module directly (where the Google Analytics configuration is easier and more straightforward) or using the Google Tag manager, where you need a bit more experience to configure it right?

  • Pipeline finished with Failed
    3 months ago
    #346615
  • Pipeline finished with Failed
    3 months ago
    #346616
  • πŸ‡¨πŸ‡·Costa Rica dharizza

    @poker10 The Google Analytics module has been marked as obsolete and its use as deprecated, the recommendation now is to use google_tag. Also, considering the persona we're trying to reach with Drupal CMS is marketers and the market share reflects the majority of them are using Google Analytics for web analytics and Google Tag Manager for tag management, the use of the google_tag module is more future proof as it allows them to keep using both.

  • πŸ‡¨πŸ‡·Costa Rica dharizza
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    This is really looking good! I think there are a few more things we should do to punch it up, but it's close to ready, IMHO.

    Also, to make sure tests run, please add this component to the components list in .gitlab-ci.yml.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    We also need to have a small enhancement in the recipe.yml file to enable the privacy settings for GA and GTM. Those are:

    config:
      actions:
        klaro.klaro_app.ga:
          simpleConfigUpdate:
            status: true
        klaro.klaro_app.gtm:
          simpleConfigUpdate:
            status: true
    

    The Klaro module and the apps are all available by default in Drupal CMS, but the apps remain disabled until something gets installed which requires them to become enabled. This is what those to config actions achieve.

    Do you want me to open a separate issue and MR for that, or could this be handled as part of this one?

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    @jurgenhaas I think that needs to be a separate issue. Can you open that, and postpone it on this one?

    I think it might make sense for the privacy recipe to enable both of those apps by default, rather than have this analytics recipe do it.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I've opened πŸ“Œ Enable privacy apps when applying Goggle Tag recipe Active and explained there why the privacy recipe can not enable all potential apps by itself.

  • Pipeline finished with Failed
    2 months ago
    Total: 53s
    #350892
  • Pipeline finished with Failed
    2 months ago
    Total: 54s
    #350893
  • Pipeline finished with Failed
    2 months ago
    Total: 1169s
    #350973
  • Pipeline finished with Failed
    2 months ago
    Total: 1245s
    #350974
  • Pipeline finished with Failed
    2 months ago
    Total: 596s
    #351020
  • Pipeline finished with Canceled
    2 months ago
    Total: 64s
    #351038
  • Pipeline finished with Failed
    2 months ago
    Total: 596s
    #351043
  • πŸ‡¨πŸ‡·Costa Rica dharizza
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    @dharizza and I worked hard on this today and we are both completely satisfied with the code of the MR. There is the same basic test coverage that we would expect in any recipe, and this is a strong foundation on which to build further. The privacy stuff, as agreed, will be dealt with in another issue.

    So, from my perspective, this is ready to go. Giving it to Pam for manual testing and final review/approval.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Thanks for getting it so close! Manually tested but I hit a bit of an issue.

    When I apply the recipe, there are all kinds of JS errors that break things. I thought this might be because the ID was fake but I tried with a real GTM ID and still had the same problem. The errors go away if I either disable JS aggregation, or uninstall GTM. Did either of you see anything similar?

  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    #13 is potentially caused by / related to πŸ› Google Tag makes CSS aggregates uncacheable Active

  • Pipeline finished with Canceled
    2 months ago
    Total: 178s
    #356887
  • Pipeline finished with Canceled
    2 months ago
    Total: 179s
    #356888
  • πŸ‡¨πŸ‡·Costa Rica dharizza
  • Pipeline finished with Failed
    2 months ago
    Total: 727s
    #356889
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Awesome! Thanks for sorting out that weird JS issue.

    The only thing is I'd like to remove it from the installer and PB for now given the dependency on the input. We are getting enough questions/complaints about things that are not quite finished, I'd like to limit the exposure!

    Other than that, RTBC from me.

  • Pipeline finished with Success
    2 months ago
    Total: 502s
    #357110
  • Pipeline finished with Skipped
    2 months ago
    #357127
  • Pipeline finished with Failed
    2 months ago
    Total: 699s
    #357123
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    And just like that, Drupal CMS has its first input-requiring recipe. :) Congrats, everyone! This is some very fine work. Merged into 0.x.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024