-
Notifications
You must be signed in to change notification settings - Fork 64
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
stageprompt version included in minified application js doesn't cater for newer Google analytics.js #913
Comments
Ah! This is why we were using our version which has that fix. Looks like we opted for the GOV.UK version when upgrading because the upstream of that fork has been archived. IMO it would be better to get this added to the upstream version which has moved to GOV.UK frontend toolkit and bump our dependencies, rather than duplicate code again. However, if this is blocking you @markhunter27 are you able to test moving back to our fork and raising an issue over on the upstream repo? |
Actually, digging a bit further into this it looks like the analytics helpers have been expanded quite a bit since we forked The best thing to do would be to try to follow the |
Cheers for the replies. We can request a change to the GOV UK toolkit, but because we're one of several services using the 'Template as a service' approach, there's some time & impact we need to consider when stepping up the shared AF dependency version. The later analytics docs you've shared look interesting & worth a look. But at the moment our service is using stageprompt attributes in a lot of places, so it won't be so quick to revise our approach. |
Apologies @markhunter27, I didn't spot this yesterday but there's actually already an open PR for this change in I'll revert back to our fork in the interim and will keep an eye on that. |
No prob cheers. Caught up with @Fenwick17 this morning - will try to get a test of your latest AF happening in our service this afternoon. |
From version 3.0.2+ the version of the stageprompt library that is being pulled in looks like an older version that doesn't cater for the newer Google Analytics API.
Causes stageprompt based analytics to fail when our service uses analytics.js
Problem/Feature
Stageprompt code is detecting elements with relevant
data-
attributes, but it's sending the event data to theglobal._gaq
object - where the information accumulates but isn't processed.Expected behaviour
The later version of stageprompt has an revised flavour of the above function - caters for both versions of GA ..
Proposed solution
Within the package.json for AF, stageprompt was previously pulled directly from the node_module dependency, e.g. from v2.252.0 :
"stageprompt": "./node_modules/stageprompt/script/stageprompt.js",
..but in the later version it's getting pulled from the the govuk_frontend_toolkit dependency
"stageprompt": "./node_modules/govuk_frontend_toolkit/javascripts/stageprompt.js",
Possibly just need to switch back to the node module version?
We can patch the relevant function locally using this script, to work around the problem ..
Explain the steps to reproduce the bug
Bug happens whenever we use AF v3.0.2 with analytics.js - stageprompt events aren't being seen.
Tell us about your environment
The text was updated successfully, but these errors were encountered: