Skip to main content

Snowflake Integration

Seamlessly export your Triple Whale data to Snowflake for powerful insights and custom analytics

Chaim Davies avatar
Written by Chaim Davies
Updated over 3 weeks ago

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 Settings > 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

  1. Username/Password

  2. PAT - Programmatic Access Token (Using programmatic access tokens for authentication)

To switch between them use the Use alternative connection method link at the bottom of the connection screen.

  1. 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

  • Database

    • Select which of your Databases in Snowflake into which Triple Whale may pass data.

  • Schema

    • Select which Schema within the selected Database you would like to use.

  • Username

    • This is your Snowflake account username

  • Password

    • This is your Snowflake account password

Once you have input the relevant data, click Save.

2. 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

  1. 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

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:

  1. Select Snowflake as the Destination: In the final step of your Workflow setup, choose Snowflake as the export destination.

  2. Configure Settings: Provide the necessary Snowflake details, such as database and schema names, to ensure your data is correctly routed for storage and analysis.

  3. 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.

Did this answer your question?