How to use custom report field universal analytics...
# ask-ai
j
How to use custom report field universal analytics?
k
To use the custom report field in Universal Analytics with Airbyte, follow these steps: 1. Authentication: - OAuth: Enter your Google application's [client ID, client secret, and refresh token](https://developers.google.com/identity/protocols/oauth2). - Service Account Key Authentication: Enter your [Google Cloud service account key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys) in JSON format. Use the service account email address to [add a user](https://support.google.com/analytics/answer/1009702) to the Google Analytics view you want to access via the API and grant [Read and Analyze permissions](https://support.google.com/analytics/answer/2884495). 2. Replication Start Date: - Enter the Replication Start Date in YYYY-MM-DD format. The data added on and after this date will be replicated. If this field is blank, Airbyte will replicate all data. 3. View ID: - Enter the [View ID](https://ga-dev-tools.appspot.com/account-explorer/) for the Google Analytics View you want to fetch data from. 4. Custom Reports: - Optionally, enter a JSON object as a string in the Custom Reports field. For details, refer to [Requesting custom reports](https://docs.airbyte.com/integrations/sources/google-analytics-v4#requesting-custom-reports). ### Example of a Custom Report A custom report is formatted as:
Copy code
json [     {       "name": "<report-name>",       "dimensions": ["<dimension-name>", ...],       "metrics": ["<metric-name>", ...]     }   ]
#### Example of a Single Custom Report:
Copy code
json [     {       "name": "page_views_and_users",       "dimensions": [         "ga:date",         "ga:pagePath",         "ga:sessionDefaultChannelGrouping"       ],       "metrics": ["ga:screenPageViews", "ga:totalUsers"]     }   ]
#### Example of Multiple Custom Reports:
Copy code
json [     {       "name": "page_views_and_users",       "dimensions": ["ga:date", "ga:pagePath"],       "metrics": ["ga:screenPageViews", "ga:totalUsers"]     },     {       "name": "sessions_by_region",       "dimensions": ["ga:date", "ga:region"],       "metrics": ["ga:totalUsers", "ga:sessions"]     }   ]
### Custom Reports with Segments and Filters When using segments, make sure you also add the
ga:segment
dimension. Example:
Copy code
json [     {       "name": "page_views_and_users",       "dimensions": ["ga:date", "ga:pagePath", "ga:segment"],       "metrics": ["ga:sessions", "ga:totalUsers"],       "segments": ["ga:sessionSource!=(direct)"],       "filter": ["ga:sessionSource!=(direct);ga:sessionSource!=(not set)"]     }   ]
### Additional Information - Each report can contain no more than 7 unique dimensions. - A custom report can contain no more than 10 unique metrics. - Incremental sync is supported only if you add the
ga:date
dimension to your custom report. For more detailed information, you can refer to the [Setup Guide](https://docs.airbyte.com