Google BigQuery: Export Audience Definitions
Use the Export Audience Definitions to export your Lytics audience definitions to Google BigQuery. You can use the exported audiences to do segmentation of users in other tools.
- Implementation Type: Server-side.
- Implementation Technique: REST API, File based transfer.
- Frequency: Batch.
- Resulting data: Audience Definitions.
The selected audience definitions are retrieved, if they use any INCLUDE statements the included audience is inlined into the exported audience's definition replacing the INCLUDE statement.
- Check if the dataset exists in BigQuery, create it if it doesn't exist
- Check if the table exists in BigQuery, if it does, check that schema match, if it does not, create a new table
- For each selected audience:
- Retrieve the FilterQL for the audience
- Inline any INCLUDE statements
- Add row to CSV file
- Start Load Job in BigQuery
By default, Lytics exports the following fields to Google BigQuery:
|Lytics Audience Field||Description||Google BigQuery Field||Type|
|ID||Audience ID (configurable)||id||string|
|Name||Audience name (configurable)||name||string|
|Slug||Audience slug (configurable)||slug||string|
Follow these steps to set up and configure an export job for Google BigQuery in the Lytics platform. If you are new to creating jobs in Lytics, see the Jobs Dashboard documentation for more information.
- Select Google Cloud from the list of providers.
- Select the Export Audience Definitions job type from the list.
- Select the Authorization you would like to use or create a new one.
- Enter a Label to identify this job you are creating in Lytics.
- (Optional) Enter a Description for further context on your job.
- From the BigQuery Project input, select the Google BigQuery Project you want to export data to.
- (optional) From the BigQuery Dataset input, select the Google BigQuery Dataset you want to export data to. If no dataset is selected, the lytics_(AID) dataset will be used. If the selected Dataset does not exist it will be created.
- (optional) In the BigQuery Table text box, enter the Google BigQuery table you want to export data to. If an existing table is not selected then one will be created. If no table name is entered
lytics_(AID)_audience_definition_exportwill be used.
- (optional) Select the Include Audience ID checkbox, to include the Audience's ID in the row.
- (optional) Select the Include Audience Name checkbox, to include the Audience's Name in the row.
- (optional) Select the Include Audience slug checkbox, to include the Audience's slug in the row.
- Click Start Export.