alphagov / govuk_frontend_toolkit

❗️GOV.UK Frontend Toolkit is deprecated, and will only receive major bug fixes and security patches.
MIT License
403 stars 107 forks source link

Add support for GA Universal #421

Closed gunjam closed 5 years ago

gunjam commented 7 years ago

Google Analytics Universal provides a function ga that sends all communication to Google Analytics. The sendGoogleAnalyticsEvent function now checks if the ga function exists and if it does, uses it.

Port of commit 6bb47fd by @robyoung

NickColley commented 7 years ago

I noticed in the previous implementation there's some tests, is it possible to get this tested here?

gunjam commented 7 years ago

I've added in the missing unit tests from the previous version.

Ta.

robyoung commented 7 years ago

Wow! @gunjam I am super impressed. How did you find that commit? I'd forgetten I even worked on that project.

NickColley commented 7 years ago

This looks good to me, but I think will be a breaking change since it'll always favour the ga global (which should be fine but is a breaking behaviour) 👍

rpowis commented 6 years ago

Hi all. Is there any chance of getting this merged? Some of our services have updated to universal analytics and I'd love to get rid of our fork of the old repo.

NickColley commented 6 years ago

Going to ping the Analytics community at GDS to see if they're OK with this change.

NickColley commented 6 years ago

This doesnt seem to be used much internally at GDS, but rather a library used for external services: https://github.com/search?l=JavaScript&p=1&q=org%3Aalphagov+GOVUK.performance&type=Code

Update: I went through these and could not find any up to date usage of this.

NickColley commented 5 years ago

I have spoken to @gunjam and got their approval for the updates I have made.

36degrees commented 5 years ago

:shipit: