> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/integrations/shopify-to-segment/send-data-from-segment-to-bigquery.md).

# Send data from Segment to BigQuery

In this article we will show you how to store your Segment data in BiqQuery. To do this, you need to follow a few steps:

1. Enable BigQuery for your Google Cloud project
2. Create a GCP service account for Segment to connect with
3. Create a warehouse in the Segment app

#### Create a Project and Enable BigQuery

1. Go to Google [Cloud Platform](https://console.cloud.google.com)

* If you don’t have a project already, [create one](https://support.google.com/cloud/answer/6251787?hl=en\&ref_topic=6158848)
* If you have an existing project, you will need to [enable the BigQuery API](https://cloud.google.com/bigquery/quickstart-web-ui). Once you’ve done so, you should see BigQuery in the “Resources” section of Cloud Platform

{% hint style="info" %}
Make sure [billing is enabled](https://support.google.com/cloud/answer/6293499#enable-billing) on your project, or Segment will not be able to write into the cluster.
{% endhint %}

3. Copy the project ID. You will need it when you create a warehouse source in the Segment app.

![](/files/WqrS24Mf1aDSp7hVJUvo)

#### Create a Service Account for Segment

Refer to [Google Cloud’s documentation about service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts) for more information.

1. From the Navigation panel on the left, go to IAM & admin > Service accounts

   ![](/files/gsDyk6LwsOTdrbn7YMnc)
2. Click Create Service Account along the top
3. Enter a name for the service account (for example: “segment-warehouses”) and click Create
4. When assigning permissions, make sure to grant the following roles:

* BigQuery Data Owner
* BigQuery Job User

![](/files/OSLfGL50PCriKdLGwaGn)

![](/files/4x6fJuMml5ZHcrRjNs8v)

5. [Create a JSON key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). The contents of the downloaded file will be used to create your warehouse in the next section.

![](/files/7TdtHLvKlbjWnUQLRIki)

#### Create the Warehouse in Segment

1. In Segment, go to Workspace > Add destination > Search for “BigQuery” - it can be found in Storage Destinations

   ![](/files/Qtsfz588z4Y8lqxr90dN)
2. Select BigQuery
3. Add a name for the destination
4. Enter your project ID in the Project field

   ![](/files/ZyLdkf5ebY5GxgAc3Hym)
5. Copy the contents of the credentials (the JSON key) into the Credentials field *Optional*: Enter a [region code](https://cloud.google.com/compute/docs/regions-zones) in the Location field (the default will be “US”)

   ![](/files/YMzcYB4sUrHQ4GA8d4op)
6. Click **Connect**
7. If Segment can connect with the provided Project ID and Credentials, a warehouse will be created and your first sync should begin shortly

Once the data will reach BigQuery, under your project, you will be able to see a new dataset with multiple tables and partitioned tables (special tables that are divided into segments that make it easier to manage and query your data).

![](/files/v9J6r3S7ecycZRL3JjwA)
