Skip to content

Release 2243

Choose a tag to compare

@github-actions github-actions released this 28 Jan 14:30
a03e3e0

Trello card

Trello-487

Context

We are migrating over to GTM instead of including GA in the application directly. To begin with we want to run GTM against a staging environment and retain the current GA implementation in production.

Changes proposed in this pull request

  • Update helpers with GTM_ID convenience methods

Rename to more generic TrackingHelper and add methods that check for GTM support.

  • Add tests for CookiePreferences class

Add unit tests and minor tidying of the CookiePreferences class.

  • Add GTM container

Add a new gtm pack and associated class to pull in the GTM container and send the default consent according to the CookiePreferences.

This will only happen if a GTM_ID is present - we can use this as the feature switch to test it in staging (ensuring we remove the GOOGLE_ANALYTICS_ID from the env vars at the same time).

Pull the gtm pack into the application layout and update relevant request specs.

  • Clean up remaining references to analytics_tracking_uuid

This cookie was removed in a previous PR; this reflects the change in the cookie policy and cleans up a few lingering references.

  • Update cookie policy for GTM

The only difference is that the _gat cookie used for throttling requests by GA will have a different name when delivered via GTM.

Guidance to review

The review and staging instances have been setup to use the staging GTM container - though staging won't work until this is deployed.

You can access the staging GA instance and staging GTM instance to see the tracking working.

You can view the minor update to cookie policy here.