Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[DISCUSS] Begin migration from classic to universal Google Analytics #548
For discussion, do not merge
I'd love to have feedback on all of the above as well as some advice on a couple of the TODOs still left:
* Create classic and universal analytics trackers that can load their tracking code, track custom events, track page views – virtual and otherwise, and set custom dimensions/variables * Create a GOVUKTracker that let’s us track to both classic and universal simultaneously
A cookie is sometimes set by apps to declare the GA parameters that should run on the subsequent page. These declare the actual methods to call in classic analytics. This is a temporary shim to ensure these are applied to both classic and universal before updating apps. * Pull cookie code from current analytics snippet * Modify to go through setDimension rather than directly to GA * Parse index and scope variables as integers
The global ga function might not be available if the analytics script couldn’t be loaded, or if the user is blocking the script from loading (eg Adblocking) * Proxy calls to ga via a `sendToGa` function which tests for the presence of the global function first.
This is a good move and I generally approve of the approach
As mentioned elsewhere it would be really good to change this to use
Also rather than using
I might leave some other comments inline.
I believe this was to force the cookies to be set on www.gov.uk. Without this, I think they get set on gov.uk, and therefore leak across to other service domains etc.
This is really nice and feels a lot cleaner already. All I have is a suggestion for the future, that once this has seen some use in live environments we add some deprecation warnings to the existing objects to give the switchover a push. (Something like using
@edds I've updated the tracker to use
It has been agreed with the analytics team that we don't need an equivalent to