Skip to content

Conversation

@kikoruiz
Copy link
Member

@kikoruiz kikoruiz commented Dec 17, 2025

Remove Google Analytics 4 integration

Description

This PR completely removes the Google Analytics 4 (GA4) tracking tag and all associated logic from the codebase. The primary motivation is to streamline our analytics strategy and reduce the complexity and performance overhead of third-party tracking scripts.

As part of this change, the responsibility for handling client_id and session_id is shifting. This data must now be set in localStorage so it can be picked up and used by Google Tag Manager (GTM). Teams will need to ensure their GTM configuration is set up to read these values from localStorage.

The changes include:

  • Removal of the GA4 script loading mechanism.
  • Deletion of any hooks or utility functions used to send events to GA4.
  • Cleanup of environment variables and configuration related to the GA4 measurement ID.

💣 BREAKING CHANGE 💣

This change is considered a BREAKING CHANGE and will result in a new major version.

  • No More Direct GA4 Data: The application will no longer send any tracking data directly to Google Analytics 4. All tracking will be managed via GTM.
  • New localStorage Requirement: The client_id and session_id are no longer handled automatically by the removed integration. They must be explicitly saved to localStorage for GTM to consume.
  • Impact on Reporting: All reports and dashboards that rely on data from our GA4 property will stop receiving new data until GTM is correctly configured to handle the event tracking. Please ensure that stakeholders are aware of this change.

Comment on lines 5 to 6
clientId: 'clientId',
sessionId: 'sessionId'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have doubts on this changes, the rest is ok for me

Copy link
Member Author

@kikoruiz kikoruiz Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oriolpuig What's your doubt about? These values have changed because right now we save them manually on a JS template in GTM, before we used the gtag API with the snake case text style.

Copy link
Contributor

@oriolpuig oriolpuig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻

} catch (e) {}

return id
export const waitForGAData = () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’re changing the strategy to obtain the GA4 IDs. With this pattern, we give the only source of truth to GTM.

@kikoruiz kikoruiz added feature and removed feature labels Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants