This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andysellick
force-pushed
the
use-analytics
branch
from
October 22, 2020 13:53
b0b3bdd
to
16d5b16
Compare
andysellick
changed the title
Add analytics to the accounts manager
[DO NOT MERGE] Add analytics to the accounts manager
Oct 22, 2020
andysellick
force-pushed
the
use-analytics
branch
from
October 22, 2020 16:01
16d5b16
to
e580764
Compare
andysellick
commented
Oct 23, 2020
alex-ju
force-pushed
the
use-analytics
branch
from
October 27, 2020 10:37
81c3c3f
to
4ca10dc
Compare
alex-ju
changed the title
[DO NOT MERGE] Add analytics to the accounts manager
Add analytics to the accounts manager
Oct 27, 2020
alex-ju
force-pushed
the
use-analytics
branch
from
October 27, 2020 12:34
4ca10dc
to
c50d2c9
Compare
- need to include google analytics domain because initialising GA involves a call to append a new script onto the DOM and run it
- note that this change depends upon analytics code being in the components gem, which at time of writing is not complete - analytics code is initialised on every page, if a previously set consent cookie is found, pageviews are sent - the registration flow includes a yes/no radio for cookie consent, choosing 'yes' sets the cookie and immediately reinitialises the analytics code, firing a pageview - if the user chooses 'no' that cookie is deleted - this preference is not currently tied to the record in the user profile although this may change
…ule to pick them up and send them to GA
Migrates analytics-track-form from https://github.com/alphagov/govuk-coronavirus-find-support/blob/master/app/assets/javascripts/analytics-track-form.js and uses it to track selected options in account-create forms.
alex-ju
force-pushed
the
use-analytics
branch
from
October 27, 2020 13:31
c50d2c9
to
a66a639
Compare
I took this over from Andy, rebased the work, and resolved conflicts then I addressed the 'Create an account' section of our analytics request which required us to:
I would be keen to address the remaining sections 'Account' and 'Going back' in a separate PR to avoid falling behind with this one as we are changing the views rather quickly these days. |
barrucadu
reviewed
Oct 27, 2020
It is unfortunate that we have to add these in the yml, but I don't see an alternative without taking the time to extract the markup and move it to the views.
alex-ju
force-pushed
the
use-analytics
branch
from
October 27, 2020 13:51
a66a639
to
a24b527
Compare
barrucadu
approved these changes
Oct 27, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Add analytics code to the accounts manager.
Depends upon alphagov/govuk_publishing_components#1745 and alphagov/govuk_publishing_components#1751 for the analytics code, so won't work until that PR is merged and we have a new version of the gem with it installed in the accounts manager. This is making the tests fail as well.
The latest commit on this PR demonstrates how to use the track click script in PR 1751 to fire a tracking event on the user create/enter email screen's 'continue' button. This is an initial test of the use of this, which will be done much more widely.
Why
We want to ask users for their consent to be tracked so that we can understand how users interact with accounts.
Visual changes
None, but it's worth explaining how this page works so it's clear and we can iterate it if necessary.
If the user selects 'yes' to cookies, the analytics code is initialised and a tracking event (pageview) is fired. If the user selects 'no' nothing happens, unless there's already a cookie, in which case it gets deleted. This might not be the best solution long term, but we can iterate it.
Trello card: https://trello.com/c/2gMj38xR/330-build-analytics