Google Analytics
Description
Confluence content
mentioned on
QAlity Plus - Test Management
Checklists
Activity
The source code for the openlmis-analytics
component lives here:
https://github.com/OpenLMIS/openlmis-ui-components/tree/master/src/openlmis-analytics
The commits linked to this Jira issue touch a lot of repos because commits happened before repositories were split. openlmis-analytics
is a shared component that lives in the OpenLMIS UI Components git repo on GitHub.
@Christine Lenihan We will have Google Analytics for online clicks. However, obtaining analytics for offline clicks/cache would take more work and I don't think it will make this sprint. Essentially we won't have information on the button clicks within the Requisition form when offline. I think this okay and we'll try to get this feature out by 3.1. Let me know if you have questions. @Chongsun Ahn will create a new ticket for offline and relate it to this ticket.
@Nick Reid Based on comments, I was just going to focus on page views (including partial page views) and button clicks. Should we include 500 error events? If not, shouldn't we remove that from the acceptance criteria?
Nick, I'm glad you pointed that out. We gotta keep this ticket simple, do-able, and get it done. Once GA is in place, we can look at the data we are getting and evaluate whether to expand the range of what is tracked.
@Chongsun Ahn Oh you picked up this ticket – did I hear y'all talking about tracking modal windows that pop up today? (I was obviously ignoring you)
Tracking modal windows ATM might be a trap — right now modals are not registered in UI-Router (which a subsection of them should be) // you could tack something into one of the modal services, or track bootstrap's modal opened event, but IMHO that is getting hacky — and GA would want to know where the user went after the modal (so it can tell when that page view ended)
If the team thinks this is a deal breaker, we can work on getting modals like total losses and adjustments or non-full supply add product to be driven by UI-Router (which might make the code cleaner overall) – but I wouldn't do that in the scope of this ticket...
Details
Assignee
Reporter
Story Points
Components
Sprint
Fix versions
Priority
Time Assistant

As a system admin/implementor, I want to enable Google Analytics (GA) to track use of my OpenLMIS deployment. In general we are setting up analytics to track behavior flow between events and page views.
This should be implemented in a way that is completely orthogonal to the currently application and require no markup or configuration on page elements or controllers
Acceptance Criteria
A config.json value in the UI which will supply the Google Analytics UA- code number
When the UI is built with a UA code, use results are visible in a GA account
Do we want to implement a tracking code on test.openlmis.org ??
Every UI-Router page state changed should be tracked within Google Analytics as an individual page view
Any click on a `<button>` element
Button clicks are registered as a GA Event
The GA event fields should be configured like the following
eventCategory: 'Button Click', eventAction: <Button message key> // This might be difficult to get, and the actual `element.text()` is a reasonable value eventLabel: <URI of the current page state from UI-Router>
All 500 level http responses returned by the OpenLMIS server
These should be tracked as an event, in a similar manner as the button clicks
GA config looks like
eventCategory: '500 Error', eventAction: <Error number, and message returned from server> eventLabel: <URI of the current page state from UI-Router>
Offline Google Analyticsis implemented, and page views, button clicks, and 500 errors are tracked This has been separated into https://openlmis.atlassian.net/browse/OLMIS-1944#icft=OLMIS-1944