Documentation / Product / Integrations / Google / Google BigQuery

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

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:

  1. Check if the dataset exists in BigQuery, create it if it doesn't exist
  2. Check if the table exists in BigQuery, if it does, check that schema match, if it does not, create a new table
  3. For each selected audience:
    1. Retrieve the FilterQL for the audience
    2. Inline any INCLUDE statements
    3. Add row to CSV file
  4. Start Load Job in BigQuery

Fields

By default, Lytics exports the following fields to Google BigQuery:

Lytics Audience FieldDescriptionGoogle BigQuery FieldType
IDAudience ID (configurable)idstring
NameAudience name (configurable)namestring
SlugAudience slug (configurable)slugstring
FilterQLFilter statementfilterstring

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.

  1. Select Google Cloud from the list of providers.
  2. Select the Export Audience Definitions job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Select the audiences to export.
  7. Complete the configuration steps for your job. bq-audience-def-config
  8. From the BigQuery Project input, select the Google BigQuery Project you want to export data to.
  9. (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.
  10. (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.
  11. (optional) Select the Include Audience ID checkbox, to include the Audience's ID in the row.
  12. (optional) Select the Include Audience Name checkbox, to include the Audience's Name in the row.
  13. (optional) Select the Include Audience slug checkbox, to include the Audience's slug in the row.
  14. Click the Start job button to start the job.