How to collect data from Google Analytics
This article will show you how to create a Metric using a Google Analytics report as a data source. It assumes that you have already established connectivity to your Google Analytics server. The process for creating a Dataset is similar.
The example shown below is for the Metric.
1. Access New > Metric
Provide the basic information required for creating a new Metric:
- Specify this Metric's Measure. If you do not see the measure that you want to use, scroll down to the bottom of the drop-down list and create a new one by clicking Add New Measure
- Select the Measurement Interval that applies to your element
- Give the Metric a unique Name
- Assign a Category
- Click Next: define details to proceed with data collection
2. Provide Data Collection Settings
On the Data tab in the Metric Editor:
- Select the Google Analytics plug-in serving as a Data Source for this Metric
- Set the Data Collection Trigger that will initiate data collection for the Metric
- Specify the View that allows access to Reports in a Google Analytics account
- Input the Plugin Command listing all the data you would like to fetch from Google Analytics (manually or using the Visual Editor)
Validate your Plug-in Command
- If your statement is valid, the statement box will be green; if there are any errors, the box will be colored in red and errors will be explained in the field below.
- Collect Data
- Enable and Publish your Metric
2.1. Example using the Visual Editor
The Google Analytics Query Builder allows constructing commands without the need to learn the plugin syntax and avoiding typos/mistakes:
- Click [Visual Editor] to select this option
- On the pop-up, add the fields by using the corresponding buttons: [+Dimension], [+Metric], [+Derived field], [+Count].
- Learn more about Dimensions & Metrics available through the Core Reporting API in Google Analytics
- All added fields and their types will be displayed above
- Specify the Start Date and End Date for data collection and Limit the number of rows that will be displayed on Save
- Determine which Segments of data you want to fetch from Google Analytics
- For more information, refer to Google Analytics Segments
Save your settings. Plugin command validation will start automatically.