-
Notifications
You must be signed in to change notification settings - Fork 26
analytics
In addition to standard page tracking, when an analysis is performed, a dummy page /analyse_dummy_search
is also hit. The purpose of this is to allow us to use the search analysis function in Google Analytics; however, it also has the effect of increasing total page hits, so it is currently disabled via a filter in our Analytics setting (since Jan 11 2016; this doesn't have a retrospective effect).
The following events are emitted:
Description | Category | Action | Label |
---|---|---|---|
When an analyse chart is loaded | search_button |
click |
hash data |
When data download link is clicked | data_link |
click |
hash data |
When items/spending button is toggled | items_spending_toggle |
click |
hash data |
When the date slider is changed | time_slider |
slide |
hash data |
The hash data after the #
in the URL is as follows:
-
org
: Indicates how the data is segmented: bypractice
(if a CCG has been specified, all practices in that CCG),CCG
orall
(all practices in England). Ifpractice
orCCG
,orgIds
must have a value: -
orgIds
: comma-separated list of organisation ids (identifying the CCG or practice in the numerator) -
numIds
: comma-separated list of numerators, each of which must be one of BNF chapter, section, para, subpara or chemical as a BNF code string -
denom
:total_list_size
,chemical
,star_pu.oral_antibacterials_item
, or empty. If it's empty, thendenomIds
must have a value: -
denomIds
: comma-separated list of denominators, each of which must be one of BNF chapter, section, para, subpara or chemical as a BNF code string - selectedTab:
summary
,chart
, ormap
The following never appear in the URL, but are used internally (and in GA):
-
source
:button
orpageload
(i.e. did someone click the button, or follow a link?). Note: this was only added around July 2016 so will not apply to data before then -
num
: never appears in URL, but 'chemical' internally
The ability to export events data is limited. Via Google Analytics, it allows you to export up to 5000 rows of data. To get the data, go to Behaviour > Events > Overview, and drill down to the search_button
Event Category. Select Event Label as the Primary Dimension, and use the drop box at the bottom to show 5000 rows. You can then Export this data with a button at the top of the page.
By selecting different, non-overlapping date windows for the data, you can pull together a full set of data, if you have enough time...
When ever anyone is logged in, we assign them a unique user id which doesn't change over time. In practice, apart from OpenPrescribing admins, the only other users who log in are email alert users, who are logged in automatically when they follow links in their emails (there's no indication to the user that they're logged in, incidentally).
Such users can be tracked in a special way in Google Analytics -- in particular, we can track them across devices, so someone who follows a link in their email and in a tablet will appear as the same user.
Because user accounts are unique to emails rather than users, in practice this is of limited use! But it could be used, in principle, to estimate the practice of email-sharing, by comparing single "users" with different geographic locations.
This user-id data is only visible in a special kind of "View", and is documented here. The view in question on our account is named "User-ID View".
Note that in addition to page views, email events (email delivery, opens, and clicks) are also tracked using this technique, so the absolute number of (e.g.) sessions will appear greater in the User-ID view.
Finally, at the time of writing, this view is unreliable due to caching, so should not be used.
Analytics events in the category "email" are triggered every time a mailgun webhook is executed. At the moment they are not appearing in the data; this is under investigation.
However, all emails are also logged to mail-signals.log
.