
---

The integration between Synerise and Google BigQuery allows users to export various types of data from Synerise to BigQuery. This is a convenient solution as it allows data to be exported and used for further analysis in BigQuery and other Google tools such as Google Analytics.

In this use case, we will show how to send metrics results (CTR, CTOR, and OR) to a BigQuery table using a dedicated node (Upload Data to Table) in our Automation Hub. The process of creating these metrics has already been described in [this use case](/use-cases/calculate-ctr-or-ctor). In the following steps, we will create a workflow for uploading these analytics to BigQuery.

## Prerequisites 
---
- Check the [requirements](/docs/automation/integration/google-bigquery/upload-data-to-bigquery#prerequisites) you must meet to integrate Synerise with Big Query.
- Prepare metrics that counts OR, CTR and CTOR based on the [use case](/use-cases//calculate-ctr-or-ctor). 

## Create a workflow
---
Create a workflow which sends metrics results to Google BigQuery. The workflow starts at 6 A.M. daily and automatically sends the up-to-date metrics results to BigQuery.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/automation-hub-icon.svg" alt="Automation Hub icon" class="icon" > **Automation Hub > Workflows > New workflow**.  
2. Enter the name of the workflow.

### Define the Scheduled Run trigger node 
---
At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the **Scheduled Run** node.

1. As the trigger node, add **Scheduled Run**.  
2. In the configuration of the node:  
    1. Leave the **Run trigger** option at default (**all time**).  
    2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace.  
    3. Define the frequency of the workflow. In this use case, it's every day at 6:00 A.M. 
    4. Confirm by clicking **Apply**.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/bq-automation.png" class="full" alt="The configuration of the Scheduled Run node"><figcaption>The configuration of the Scheduled Run node</figcaption></figure>

### Configure the Upload Data to Table node 
---
At this stage, we will configure the BigQuery node.

1. As the next node, add **Google BigQuery > Upload Data to Table**.
2. Fill out the form according to the instructions in the **Define the integration settings** section.
3. In the **Rows** field, enter JSON that extracts the ID of specific metrics. 


   <pre><code class="language-json">[{
       "insertId": "{{ currentStep.actionId }}",
       "json": {
               "data": "{% set today = timestamp|timestamp_to_time|datetimeformat('%d.%m.%Y', tz="Europe/Warsaw" ) %}{{today}}",
               "ctr": "{% metricvar d3cbeffb-4883-4621-a403-15e4bddc4650 %}",
               "or": "{% metricvar 69af6a34-02d9-4a11-8436-1c8967b0abf3 %}",
               "ctor": "{% metricvar 373dc09a-552d-4108-a713-e0261ac86516 %}"
           }
   }]</code></pre>


### Add the finishing node 
---
1. Add the **End** node.
2. In the upper right corner, click **Save & Run**.  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/bq-automation1.png" class="full" alt="The configuration of the Workflow"><figcaption>The configuration of the Workflow</figcaption></figure>


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The metrics presented in this case are just examples. You can export any other analytics you need with the Upload Data to Table node. All you have to do is replace the syntax with relevant jinjava inserts and add the corresponding analytics ID.

</div></div></div>



## Check the use case set up on the Synerise Demo workspace
---
You can check [the configuration of the workflow](https://app.synerise.com/automations/automation-diagram/d161330f-deb9-4a6f-aff5-a07ec13fd945) directly in the Synerise Demo workspace.

If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.

## Read more
---
- [Automation Hub](/docs/automation)
- [Uploading data to BigQuery](/docs/automation/integration/google-bigquery/upload-data-to-bigquery)