If you would like to access your Funnel data in a Snowflake data warehouse, you can do so by setting up a new Snowflake Export. This article covers how to configure your Snowflake environment with a dedicated user and permissions, and how to authenticate the connection in Funnel using a programmatic access token (PAT).
To export data to Snowflake, first run a series of SQL commands in your Snowflake account to create a specific user, role, and network policy. This ensures Funnel has the correct permissions and network access to write data to your specified database.
Step 1. Configure Snowflake
You will need to run the following SQL commands in a Snowflake worksheet to set up the necessary environment. If you already have a user and created the required roles granted permissions to the user, go to step 1.3.
(Optional) Step 1.1 Create user and database
Set up the service user and the database where Funnel will write your data.
SQL
-- Create a specific user for the Funnel export
CREATE USER IF NOT EXISTS "funnel_export" LOGIN_NAME="funnel_export" TYPE = service;
-- Create the database where data will be stored
CREATE DATABASE funnel_database;
-- (Optional) Create a specific warehouse for Funnel exports
CREATE WAREHOUSE funnel_warehouse WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 30;
(Optional) Step 1.2 Create role and grant permissions
Create a specific role to manage permissions and assign it to the new user.
SQL
-- Create a new role
CREATE ROLE funnel_role;
-- Grant usage on the database and warehouse to the role
GRANT USAGE ON DATABASE funnel_database TO ROLE funnel_role;
GRANT ROLE funnel_role to USER "funnel_export";
-- Set default role and warehouse for the user
ALTER USER "funnel_export" SET DEFAULT_ROLE = funnel_role DEFAULT_WAREHOUSE = funnel_warehouse;
-- Grant permissions to create schemas and use the warehouse
GRANT USAGE ON WAREHOUSE funnel_warehouse TO ROLE funnel_role;
GRANT CREATE SCHEMA ON DATABASE funnel_database TO ROLE funnel_role;
Step 1.3 Set up network rules (allowlist IP addresses)
Create a network rule to allow Funnel's IP addresses to access your instance. Choose the IP that matches the service you are using:
app.funnel.io:
54.81.136.8app.eu.funnel.io:
18.193.167.135
Run the following commands:
Note: The example uses the US IP 54.81.136.8.
SQL
-- Create the Network Rule
CREATE NETWORK RULE FUNNEL_IP TYPE = 'IPV4' VALUE_LIST = ('54.81.136.8/0');
-- Create the Network Policy
CREATE NETWORK POLICY FUNNEL_NETWORK_RULE;
-- Apply the rule to the policy
ALTER NETWORK POLICY FUNNEL_NETWORK_RULE SET ALLOWED_NETWORK_RULE_LIST = (FUNNEL_IP);
-- Apply the policy to the Funnel user
ALTER USER "funnel_export" SET NETWORK_POLICY = FUNNEL_NETWORK_RULE;
Step 1.4 Generate authentication token
Generate the programmatic access token (PAT) required to authenticate the connection in Funnel.
Note: You can adjust the DAYS_TO_EXPIRY value, for example to 150 days, as needed for your security requirements.
SQL
ALTER USER "funnel_export" ADD PAT funnel_token ROLE_RESTRICTION = funnel_role DAYS_TO_EXPIRY = 150;
Important: Copy the generated token immediately. You will need to paste this into Funnel in the next step.
Step 2. Set up the export in Funnel
After you configure your Snowflake environment, you can set up the export in Funnel.
Go to the Export page in Funnel, and click + Create Export.
Select Snowflake as your destination. You can search for the destination in the search bar.
Enter a name for this export.
Enter your Snowflake Account Identifier. This is your unique account URL prefix. For example, it may look like
xy12345.us-east-1or similar region-specific identifier.
Enter the table name, database name, schema name and user name you created.
Paste the token you generated in step 1.4 in the Programmatic Access Token (PAT) field.
Choose the data you want to export.
You can customize this data using the following settings:Import settings from a view
Choose fields and edit the field format
Filter data
Choose currency
Select the time series for your export.
Select a date range.
Data will be overwritten so include the entire period you want to be visible in Snowflake. If you for example select Last 6 months data will not accumulate and you will always have exactly the last 6 months in your Snowflake table.
Schedule your export.
(Optional) Add any notes if required.
Save the export, and click Run job to start sending data immediately.
Tip: Refer the Account identifiers section in Snowflake documentation to learn how to identify your account details that’s needed in steps 2.4, 2.5 and 2.6.
After you run the export has run, your data will be available in the funnel_database or the specific database you created and is ready to be queried using standard SQL.
