Skip to main content
Google BigQuery

Send Treefort custom analytics data directly to BigQuery

Updated over a week ago

If you want more direct access to the raw analytics data that Treefort collects, one way to get it is to set up an integration with Google BigQuery. In this way, we can sync your analytics directly to your BigQuery project, where you can run custom queries.

πŸ‘‰ This guide assumes that you already have a BigQuery project set up. If you don't, please first follow the instructions found here.

🚧 This integration will incur charges from Google based on the amount of data being transferred into and stored by BigQuery, and the cost will vary based on your users' usage. If you are concerned about the amount of data to be transferred, reach out to Treefort support and we can provide an estimate of roughly how much data will be sent per day.

Setup Instructions

  1. Enable API access to your BigQuery project (if it isn't already enabled).

  2. Ensure that billing is enabled for your BigQuery project.

  3. Note your BigQuery project ID.

  4. Create a new Google Cloud Storage (GCS) bucket (or provide an existing one). This is used to store files before loading the data into your BigQuery instance.

    • Ensure this bucket is in the same region as your BigQuery project.

  5. Create a service account with the necessary permissions for Treefort to send data to your BigQuery project:

    1. Create a new service account by going to IAM & Admin > Service Accounts.

    2. Add the following service account roles to the account:

      • Storage Object Creator

      • Storage Object Viewer

      • BigQuery Job User

      • BigQuery Data Owner

  6. Create a new key for the service account with JSON as the type and download it.

  7. Send Treefort the following information using a one-time password sharing service such as Onetime Secret:

    1. The BigQuery project ID

    2. The GCP region your dataset is in

    3. The GCP Storage bucket name

    4. (Optional) A prefix to use when storing data in your bucket (if specified, a folder will be created in your bucket and all data will be pushed there)

    5. (Optional) A schema name where all tables should be created

    6. The JSON private key for the service account that you created above

    7. Your desired sync frequency (how often Treefort will send data to BigQuery): 30 minutes, 1 hour, 3 hours, 6 hours, 12 hours, or 24 hours

Once we receive the above information, we'll configure things on the Treefort side and start sending analytics data to you!

Did this answer your question?