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.
Integration Details
- 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.
Steps/Pattern:
- 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
Fields
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 |
FilterQL | Filter statement | filter | string |
ly_exported_ts | Time of export | ly_exported_ts | date |
ly_created_ts | Time audience was created | ly_created_ts | date |
ly_updated_ts | Time audience was updated | ly_updated_ts | date |
Configuration
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_export
will 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.