Overview
Integrating Triple Whale with Snowflake allows you to seamlessly export data for in-depth analysis and custom reporting, empowering a data-driven approach to business growth. Through Triple Whale’s Workflows feature, you can send data directly to Snowflake, enabling you to consolidate, analyze, and model your marketing data alongside other business insights.
With Snowflake’s advanced analytics capabilities, you can perform complex queries, track trends over time, and gain a more granular understanding of your marketing impact, ultimately allowing for more informed, strategic decision-making.
Get Connected
To get started, head to Data > Integrations. Locate Snowflake and click Connect.
A brief walkthrough video of connecting Snowflake to Triple Whale.
Connection Types
There are two option to set the connection with snowflake
Username/Password
PAT - Programmatic Access Token (Using programmatic access tokens for authentication)
Key Pair Authentication (using an RSA key pair — Snowflake's recommended method for service connections)
To switch between them use the Use alternative connection method link at the bottom of the connection screen.
Username/Password
You will be prompted for the following account information:
AccountId
Locate your Account URL from the Account Settings menu. It will resemble something like
PF05357.us-central1.gcp.snowflakecomputing.com)
Warehouse
Select the Snowflake warehouse you would like to use for processing the data
Database
Schema
Username
This is your Snowflake account username
Password
This is your Snowflake account password
Once you have input the relevant data, click Save.
PAT - Programmatic Access Token
PAT Token
To generate the PAT Token you need to run the following commands.
These will generate the prerequisites and the PAT Token
Create a Dedicated Role
CREATE ROLE IF NOT EXISTS TW_INTEGRATION_ROLE; -- Warehouse access (required to run queries)
GRANT USAGE ON WAREHOUSE <WAREHOUSE_NAME> TO ROLE TW_INTEGRATION_ROLE;
-- Database & Schema access
GRANT USAGE ON DATABASE <DB_NAME> TO ROLE TW_INTEGRATION_ROLE;
GRANT USAGE ON SCHEMA <DB_NAME>.<SCHEMA_NAME> TO ROLE TW_INTEGRATION_ROLE;
-- Allow table creation (if needed)
GRANT CREATE TABLE ON SCHEMA <DB_NAME>.<SCHEMA_NAME> TO ROLE TW_INTEGRATION_ROLE;
-- Insert permissions
GRANT INSERT ON ALL TABLES IN SCHEMA <DB_NAME>.<SCHEMA_NAME> TO ROLE TW_INTEGRATION_ROLE;
GRANT INSERT ON FUTURE TABLES IN SCHEMA <DB_NAME>.<SCHEMA_NAME> TO ROLE TW_INTEGRATION_ROLE;
2. Create a Dedicated Integration User
CREATE USER IF NOT EXISTS triplewhale_integration
DEFAULT_WAREHOUSE = <WAREHOUSE_NAME>;
-- Grant the integration role to the user
GRANT ROLE TW_INTEGRATION_ROLE TO USER triplewhale_integration;
-- Set the role as default (after it has been granted)
ALTER USER triplewhale_integration SET DEFAULT_ROLE = TW_INTEGRATION_ROLE;
3. Create an Authentication Policy for PAT without IP Enforcement
CREATE AUTHENTICATION POLICY IF NOT EXISTS triplewhale_pat_policy AUTHENTICATION_METHODS = ('PROGRAMMATIC_ACCESS_TOKEN') PAT_POLICY = ( NETWORK_POLICY_EVALUATION = NOT_ENFORCED );
-- Attach the policy to the integration user
ALTER USER triplewhale_integration
SET AUTHENTICATION POLICY triplewhale_pat_policy;
4. Issue a Programmatic Access Token (PAT – 365 Days)
Important:
Copy the PAT secret that is displayed immediately after running this command. It is shown only once and must be provided to Triple Whale in the integration form.
ALTER USER triplewhale_integration
ADD PROGRAMMATIC ACCESS TOKEN tw_export_token
DAYS_TO_EXPIRY = 365
COMMENT='Triple Whale export PAT (365 days)';
-- Verify: - (Optional)
SHOW USER PROGRAMMATIC ACCESS TOKENS FOR USER triplewhale_integration; SHOW USERS LIKE 'TRIPLEWHALE_INTEGRATION'; -- HAS_PAT should be TRUE
Key Pair Authentication
There are three steps:
Generate a key pair (on your computer) — 3 terminal commands.
Register the public key in Snowflake — 1 SQL command.
Verify it works — 1 SQL command.
Then you hand Triple Whale the private key through the connection form.
You will create two files: a private key (your secret — never share it) and a public key (safe to share — this is what goes into Snowflake).
Step 1 — Generate the key pair (terminal)
Open a terminal (macOS / Linux) and run these three commands. They create a folder, a private key, and the matching public key.
1. Create a folder to hold the keys
mkdir -p ~/snowflake-keys && cd ~/snowflake-keys
2. Generate the PRIVATE key (PKCS#8 format, unencrypted)
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
3. Extract the matching PUBLIC key
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
Expected output — step 3 prints a single line, and both files now exist:
writing RSA key
ls -la ~/snowflake-keys
# -rw------- rsa_key.p8 ← PRIVATE key (your secret)
# -rw-r--r-- rsa_key.pub ← PUBLIC key (safe to share)
Step 2 — Register the public key in Snowflake (SQL)
Snowflake wants the public key as one continuous line, without the BEGIN/END header lines.
Produce that string:
grep -v "PUBLIC KEY" ~/snowflake-keys/rsa_key.pub | tr -d '\n'; echo
Expected output — one long line of letters/numbers (yours will differ):
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv63HCz2B+IDJM... (continues) ...rwIDAQAB
Copy that line. Then in Snowflake (Snowsight → + → SQL File), run — replacing YOUR_USERNAME with your Snowflake username and pasting your public key string:
ALTER USER YOUR_USERNAME SET RSA_PUBLIC_KEY='<paste-the-one-line-public-key-here>';
Expected output:
Statement executed successfully.
Don’t know your username? Run SELECT CURRENT_USER(); first. Permission error on ALTER USER? You need a role allowed to alter the user (e.g. ACCOUNTADMIN, or the user altering their own key). Switch role and retry.
Step 3 — Verify the public key was registered (SQL)
DESC USER YOUR_USERNAME;
Expected output — look for the row RSA_PUBLIC_KEY_FP. Its value should be a fingerprint, not null:
property value ------------------- --------------------------- RSA_PUBLIC_KEY_FP SHA256:abc123def456.....=
If RSA_PUBLIC_KEY_FP shows a SHA256:... value, the key is registered correctly. ✅
Step 4 — Gather your connection details
You’ll need these for the Triple Whale connection form. Run this in Snowflake:
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS account_identifier,
CURRENT_USER() AS username, CURRENT_WAREHOUSE() AS warehouse;
Expected output (example):
ACCOUNT_IDENTIFIER USERNAME WAREHOUSE -------------------- ---------- ----------- XCIDOZG-LX35517 SHIMONTW COMPUTE_WH
If WAREHOUSE comes back empty, run SHOW WAREHOUSES; and pick any name from the list.
You will also need your Database and Schema names (the ones you want Triple Whale to write to).
Step 5 — Connect in Triple Whale
In the Triple Whale Snowflake connection form, choose the Key Pair authentication option and fill in:
Field | Value |
Account | from Step 4 (e.g. |
Username | from Step 4 (e.g. |
Warehouse | from Step 4 (e.g. |
Database | the database to write to |
Schema | the schema to write to |
Role | the role to use (e.g. |
Private Key | paste the entire contents of |
To print the private key for copying:
cat ~/snowflake-keys/rsa_key.p8
Security: the private key is a secret — handle it like a password. Triple Whale stores it the same way it stores a connection password or token. Never commit it to git or share it over chat/email. You alone hold it; you can rotate it at any time by generating a new pair and re-running Step 2 with the new public key — which immediately invalidates the old one on Snowflake’s side.
Troubleshooting
Symptom | Cause / Fix |
| Public key in Snowflake doesn’t match the private key you provided. Re-run Step 2 with the public key derived from this private key. |
| Username mismatch, or |
| The |
Pasted public key has extra spaces/line breaks | The public key string in Step 2 must be one line with no |
| No action needed. Triple Whale automatically normalizes the pasted private key, so the connection still works. Paste the entire contents of rsa_key.p8, including the -----BEGIN/END PRIVATE KEY----- lines. |
Using Workflows for Exporting Data to Snowflake
Triple Whale’s workflows feature makes it easy to export data to Snowflake, enabling advanced analysis and custom reporting. Here’s how to get started:
Select Snowflake as the Destination: In the final step of your Workflow setup, choose Snowflake as the export destination.
Configure Settings: Provide the necessary Snowflake details, such as database and schema names, to ensure your data is correctly routed for storage and analysis.
Schedule and Run: Decide whether to run the Workflow on-demand or at scheduled intervals. Scheduling ensures data is consistently sent to Snowflake, keeping your insights up-to-date for accurate analysis.
Practical Examples for Exporting Data to Snowflake
With Snowflake as your data destination, Workflows can automate critical analytics tasks, including:
Automated Performance Reporting: Export key performance metrics to Snowflake, allowing you to run advanced queries and keep reports up-to-date with the latest data.
Detailed Transaction Analysis: Sync detailed transaction data to Snowflake to perform comprehensive analyses of customer behavior, purchase trends, and revenue performance.
Unified Marketing Attribution: Consolidate data from multiple channels in Snowflake to gain a clearer view of marketing attribution and calculate a more accurate ROI.
Custom Data Models and Dashboards: Use data from Triple Whale in Snowflake to build tailored data models and dashboards that fit your unique business metrics and analytical needs.
Conclusion
By exporting data from Triple Whale to Snowflake, you gain the flexibility to conduct complex analyses, build custom reports, and make data-driven decisions with confidence. This integration turns raw data into actionable insights, supporting smarter strategies and sustainable business growth.







