Skip to content
This repository has been archived by the owner. It is now read-only.

Include Google Analytics tracking code #59

Merged
merged 4 commits into from Feb 11, 2015
Merged

Include Google Analytics tracking code #59

merged 4 commits into from Feb 11, 2015

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Feb 10, 2015

All apps except Transition currently use the same tracking code and ID (Transition should be updated to use this too), which makes the code something that can be consistently added to all apps. This will prevent new apps from forgetting to include analytics.

  • Use the GOV.UK apps profile ID
  • Only include analytics in a Rails production environment (this includes preview), matching existing implementations.
  • Make it easier to track events and pageviews using GOVUKAdmin.trackEvent and GOVUKAdmin.trackPageview.

This is a breaking change and apps updating will need to ensure they remove their own tracking code and update uses of GOVUKAdmin.track.

@fofr fofr closed this Feb 11, 2015
@fofr fofr reopened this Feb 11, 2015
README.md Outdated
@@ -10,6 +10,7 @@ This gem provides (via a Rails engine):
* Admin design patterns available from `/style-guide` (when routes are mounted)
* [CSS helpers and SASS variables](CSS.md) for the admin theme
* GOV.UK user friendly date formats
* Google Analytics tracking code (Universal Analytics), using the "GOV.UK apps" profile ID `UA-26179049-6`

This comment has been minimized.

@benilovj

benilovj Feb 11, 2015
Contributor

Not sure about the hard-coding of the profile ID here - maybe just deep-link to /govuk_admin_template.html.erb?

This comment has been minimized.

@fofr

fofr Feb 11, 2015
Author Contributor

I agree, I've removed it.

fofr added 4 commits Feb 10, 2015
* All apps currently use the same tracking code and ID
* Use the GOV.UK apps profile ID
* Only include analytics in a Rails production environment (this
includes preview)
As GA is provided via this gem, no app will be using the older tracking
code, so we can remove the old event generation code and tests.
* Easily track virtual pageviews from within any admin app
* Rename `track` to `trackEvent` to distinguish between the two types
of things that can be tracked

This is a breaking change and apps using `track` will need to be
updated.
Allow tracking of path and title if an app needs it
@fofr fofr force-pushed the analytics branch from 5357025 to 02de8ca Feb 11, 2015
@benilovj
Copy link
Contributor

@benilovj benilovj commented Feb 11, 2015

LGTM

benilovj added a commit that referenced this pull request Feb 11, 2015
Include Google Analytics tracking code
@benilovj benilovj merged commit 5c25708 into master Feb 11, 2015
1 check passed
1 check passed
default "Build #95 succeeded on Jenkins"
Details
@benilovj benilovj deleted the analytics branch Feb 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.