To define the Google Analytics source:
- Add a Google Analytics source component to begin your dataflow.
- Open the component and name it.
source settingsDefine the source settings parameters. You can see further definition and example of the parameters on the Query Explorer site.
- analytics connection - either click the dropdown arrow and select an existing connection, or click create new to create a new connection (see Defining connections).
- profile ids - Leave empty to read data for all accessible Google Analytics profiles or the ids of your Google Analytics profiles (or tables) in the form of ga:xxx. You can enter multiple ids separated by comma. Use the Account Explorer tool to get a list of the profiles you have access to.
- dimensions (optional) - Select dimensions from the dropdown list of dimensions.
- metrics - Select metrics from the dropdown list of metrics.
- segment (optional) - Select a segment from the dropdown list of segments or write your own.
- filters (optional) - Enter a filter to retrieve a subset of the data.
- sort (optional) - Enter the sort order and sort field.
- date range - Enter the Start date and End date to filter the data. Click on each date and select the date from the calendar. You can also use variables as values for the custom date range in the format
- sampling level - Set the sampling level for the query.
HIGHER_PRECISION. See the Google Analytics sampling section for more details.
- include empty rows - if unchecked, records where all metric values are zero will be omitted.
- profile id field name - Modify the name that will appear as the field for profile ID.
- account name field name - Modify the name that will appear as the field for account name.
- property name field name - Modify the name that will appear as the field for property name.
- profile name field name - Modify the name that will appear as the field for profile name.
Then click the Test Connection button to help check that the connection is good and that the profile ids exist.report fields mapping
After defining the dimension and metrics source settings, the field names and data types will be populated. You can make these modifications to the list of fields:
- Define how you will refer to these fields (alias) in the other components of your package. If you use illegal characters, we'll let you know before you close the dialog.
- Remove report fields from the list.
Click the Show data preview button to preview the analytics data for your source settings.
Note: Google analytics allows a maximum of 7 dimensions and 10 metrics in any one API request. A workaround could be to use several Google Analytics source components with the same dimensions and different metrics and then join them on the profile id and dimensions.