Google Analytics (UA) plugin
Visit our website to see the data that you can access if you use this plugin to add the data source to SquaredUp:
How to add a Google Analytics UA data source
There are two Google Analytics data sources, this article covers the v3 version which is most frequently referred to as Universal Analytics (UA). Users are being forced from UA to the newer GA4 with UA being end-of-life mid-2023.
See Google Analytics (GA4) plugin
Prerequisites
In the GCP console select your project and check that the following are enabled:
Google Analytics Data API
GCP Service Account Configuration
Create a new Service Account, or edit an existing account.
Ensure the account has the role Viewer by adding the role Basic > Viewer.
Create a new key for the Service Account using the key type JSON. Download the JSON file as you will need to copy information from this JSON file when adding the data source next.
See GCP - Creating service account keys
Make sure to store the key file securely, because it can be used to authenticate as your service account.
Add a Google Analytics data source to SquaredUp
To add a data source click on the + next to Data Sources on the left-hand menu in SquaredUp. Search for the data source and click on it to open the Configure data source page.
Open the JSON file that you downloaded when creating the key.
Copy and paste the clientEmailfrom the JSON file into the data source form.
Copy and paste the private_key from the JSON file into the data source form (everything between the quotes).
Optionally, select whether you would like to restrict access to this data source instance. By default, restricted access is set to off.
Restrict access to this data sourceThe term data source here really means data source instance. For example, a user may configure two instances of the AWS data source, one for their development environment and one for production. In that case, each data source instance has its own access control settings.
By default, Restrict access to this data source is set to off. The data source can be viewed, edited and administered by anyone. If you would like to control who has access to this data source, switch Restrict access to this data source to on.
Use the Restrict access to this data source dropdown to control who has access to the workspace:
By default, the user setting the permissions for the data source will be given Full Control and the Everyone group will be given Link to workspace permissions.
Tailor access to the data source, as required, by selecting individual users or user groups from the dropdown and giving them Link to workspace or Full Control permissions.
If the user is not available from the dropdown, you are able to invite them to the data source by typing in their email address and then clicking Add. The new user will then receive an email inviting them to create an account on SquaredUp. Once the account has been created, they will gain access to the organization.
At least one user or group must be given Full Control.
Admin users can edit the configuration, modify the Access Control List (ACL) and delete the data source, regardless of the ACL chosen.
Data source access levelsAccess Level:
Link to workspace
- User can link the data source to any workspace they have at least Editor permissions for.
- Data from the data source can then be viewed by anyone with any access to the workspace.
User can share the data source data with anyone they want.
User cannot configure the data source in any way, or delete it.
Full Control - User can change the data source configuration, ACL, and delete the data source.
See Access control for more information.
Click Add.
You can also add a data source from Settings > Data Sources > Add data source, but sample dashboards are not added when using this method.
Using the Google Analytics UA data streams
Creating data streams
A configurable data stream allows you to easily create new data streams specific to your needs, by entering information into a form, such as metric names or queries. Configurable data streams have a cog icon next to their name in the tile editor.
Any data stream you create can be edited by clicking the edit button (pencil) next to it in the tile editor, and also from Settings > Advanced > Data Streams.
The data source will index the Google Analytics accounts and some of the common items below them. Currently all data streams require that at least one Profiles (Views) item be scoped to produce data. Once scoped the user will have the choice of a couple built-in data streams as well as three configurable data streams details below.
The UA Query Explorer can be used to lookup metrics and dimensions for a property, as well as query to see what data is available.
Metric Query (UA)
This configurable data stream accepts one or more metrics (e.g. ga:users) and returns that metric for the scoped profile in a graphable format.
Metrics by Dimension (UA)
This configurable data stream accepts one or more metrics (e.g. ga:users) as well as a single dimension (e.g. ga:pagePath) and returns that metrics in a graphable format, grouped by the dimension for the scoped profile. Using the two examples would give you website users per page.
Report Query (UA)
This is the least constrictive configurable data stream. It accepts one or more metrics (e.g. ga:users) as well as a one or more dimensions (e.g. ga:pagePath) and returns that metrics grouped by the dimension for the scoped profile. This data comes back as a table and cannot be as easily graphed.