Configuring Analytics
#
PrerequisitesNote: If you have never used Google Analytics before, take a quick look at the beginner series of tutorials.
Make sure you have access to the iQmetrix Google Analytics account. Send email to ITSupport@iqmetrix.com to request access.
#
Creating a Property for Your AppLogin to Google Analytics and navigate to
Admin
using the sidebar.If the Hub app that you want to manage does not already have a Google Analytics account associated with it, you will need to create one:
Select
Create Property
.Enter your app name in
Website Name
.Fill out the other fields as necessary.
Grant permissions to the app team.
Go to
Property
dropdown, and select your app.In the
Property
panel, selectUser Management
.Scroll down to
Add permissions for
and add the emails of your app team and choose their level of access.The developers you added should get an email to their Google accounts with information on how to access this Google Analytics account.
#
Adding User-ID tracking to Your v1 AppIn
app.js
, use the tracker’senableUserIdTracking()
method.Make sure to send the proper User Context. If you are impersonating another company, consider which id you want to send, iQ or the impersonated company.
In Google Analytics, turn on User-ID tracking.
Navigate to
Admin
>Tracking Info
>User-ID
Follow the instructions to enable User-ID tracking.
Create a new view.
Eg.
General View
.Adding user tracking is similar to adding a filter to the data, the data will be different than that of views without user tracking.
#
Creating Views#
Filtering EnvironmentsIn Google Analytics, you can create filters to see data from specific environments, such as Integration (hubint) or Production (hub). This is done through creating views.
Select the Propriety you want to modify
Create a new view and choose a name to identify the filter.
Eg.
Commission - Production
orCommission - Integration
Select
Filters
>Add Filter
.Select
Apply existing Filter
Select the filter to apply.
Eg.
Hub Production Filter
Save
After saving, you can view the details of the filter.
#
Filtering Internal IPsYou can filter analytics between internal and external users.
Follow the previous steps to create a new view filtered.
Eg.
Commission - Production w/o IQ IPs
.Add the
Hub Production
filter created above.Add IP Filters for the iQmetrix Offices. You will need to add 2 filters for each office.
Exclude internal traffic
Exclude Regina 1
Exclude Regina 2
Exclude Winnipeg 1
Exclude Winnipeg 2
Exclude Vancouver 1
Exclude Vancouver 2
Exclude Charlotte 1
Exclude Charlotte 2
#
Adding Google Analytics to Your App#
ReactFor React apps, follow the instructions from the @iqmetrix/analytics
When using the @iqmetrix/cra-template, Google Analytics is configured using the default Tracking ID.
#
Hub V1Login to Google Analytics and navigate to
Admin
using the sidebar.Navigate to your app using the
Property
dropdown.Select
Property Settings
>Get Tracking ID
and copy your Tracking ID.Add the tracking script to your
app.es6.js
.Add the HubCommon tracker util with the
Tracking ID
toapp.es6.js
.Any files where you would like to track an event, you will need to import the tracker, and use the tracker’s
sendEvent
method. More details