Bucket and Permissions Setup
To sync data from Triple Whale to Google Cloud Storage (GCS), you must create a storage bucket and grant the necessary permissions. This guide walks you through the setup process to ensure a seamless connection.
Step 1: Create a GCS Bucket
-
Open the Google Cloud Console and navigate to Cloud Storage > Buckets. Click Create.
-
Enter a Bucket Name (e.g.,
triplewhale-data
), and configure additional settings as needed. Learn more about creating GCS buckets -
Click Create to finalize.
Step 2: Grant Permissions to the Service Account
Triple Whale requires specific permissions to write data to your GCS bucket.
-
Locate and select the bucket created in Step 1.
-
Navigate to the Permissions tab.
-
Click Grant Access to add a new permission.
Granting access to the service account in GCS.
-
In the New principals field, enter the Triple Whale service account email:
srv-gcs-exporter@shofifi.iam.gserviceaccount.com
-
Under Role, select both of the following:
- Storage Object Creator (Allows writing data to the bucket).
- Storage Object Viewer (Allows reading data from the bucket).
Assigning the required roles to the service account.
-
Click Save to apply the changes.
Connecting to Triple Whale
Once your GCS bucket is set up, connect it to Triple Whale:
-
Go to your Triple Whale Integrations page.
-
Click Connect on the Google Cloud Storage integration.
Connecting Google Cloud Storage to Triple Whale.
-
Enter the bucket name created in Step 1 (e.g.,
triplewhale-data
). -
Click the checkbox confirming that you added the Triple Whale service account (Step 2).
-
Click Save to complete the setup.
Creating an Agent to Schedule Your Sync
After connecting your GCS warehouse to Triple Whale, you can automate data exports by creating an Agent.
-
Open Agents
Go to Moby > Shop’s Agents in your Triple Whale account. Click New Agent or select an existing one to edit. -
Set GCS Table as Your Destination
In the Agent builder, add a Send to Destinations step and pick Sync to Warehouse. Click Select Provider to choose your connected GCS warehouse, and enter the Table ID where you wish to send your data (this should be a unique Table ID that doesn't already exist). -
Define Query
Check Use dedicated query, and provide your desired SQL query for the data export. (Note: For smaller exports, you may instead write a custom SQL query using a Get Data step in your agent, though we recommend the Use dedicated query for larger exports.) -
Configure Your Schedule
Choose how often you want the Agent to run (e.g., hourly). Once saved, Triple Whale will automatically send new rows to your GCS dataset on that schedule.
Troubleshooting
Common Errors and Fixes
- "Service account does not exist": Ensure that you entered the correct service account email when granting permissions.
- "Access Denied": This error indicates insufficient permissions. Go to Cloud Storage > Bucket Permissions and ensure the service account has both Storage Object Creator and Storage Object Viewer roles.
- "Bucket Not Found": Double-check that the correct bucket name was entered in the integration settings.