Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review GA implementation #3035

Closed
rmccar opened this issue Feb 5, 2024 · 1 comment · Fixed by #3069
Closed

Review GA implementation #3035

rmccar opened this issue Feb 5, 2024 · 1 comment · Fixed by #3069
Assignees
Labels
Enhancement Change of existing feature Spike Requires investigation outside BAU work

Comments

@rmccar
Copy link
Contributor

rmccar commented Feb 5, 2024

The way that we have set up Google Analytics is slightly different to how Google recommends in these two ways:

  • This line in the analytics file is directly sending data to the dataLayer rather than using the gtag function to do it.
  • The format of the data we send doesn't include an event, like what is recommended here in the GA documentation. Our data is still being sent to the dataLayer but not inside of a custom event. This may improve the data that is collected and analysed by GA. To implement this we would need to potentially prefix the event name with something to avoid using reserved words as event names such as "click" and "error".

This needs some investigation into what affect making these changes has and if it improves the data that we are able to collect.

@rmccar rmccar added Enhancement Change of existing feature Spike Requires investigation outside BAU work labels Feb 5, 2024
@rmccar
Copy link
Contributor Author

rmccar commented Feb 19, 2024

There are two ways of pushing to the datalayer. Manually using dataLayer.push() or using the gtag function. I think a solution that would use the gtag function if it exists and then if it doesn't use dataLayer.push(). One solution could be to just always use gtag but if it doesn't exist just initialise the function which will then just use dataLayer.push() within it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature Spike Requires investigation outside BAU work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants