Skip to content

Commit

Permalink
Use GA4 init code
Browse files Browse the repository at this point in the history
- runs the new GA4 init code, which starts the analytics code only after cookie consent
- note that this will not run anywhere but integration because the code it refers to is only included on integration
  • Loading branch information
andysellick committed Sep 8, 2022
1 parent adcc437 commit e022a69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/analytics.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@ window.GOVUK.analyticsVars.linkedDomains = linkedDomains
if (typeof window.GOVUK.analyticsInit !== 'undefined') {
window.GOVUK.analyticsInit()
}

if (typeof window.GOVUK.analyticsGA4.init !== 'undefined') {
window.GOVUK.analyticsGA4.init()
}

0 comments on commit e022a69

Please sign in to comment.