Docs
Tracking
Snowflake Setup

Snowflake Setup

Complete the following steps to get your Snowflake connector up and running:

  1. Navigate to Project Settings, then select Warehouse Sources.
  2. Click on + Add Connection and select Snowflake.
  3. You should see a new page to create your snowflake connector. In the first view, fill out the following fields before clicking Next:
    • Snowflake Account Name / URL
    • Username
    • Role
    • Authentication Type. We support both Password and Key Pair. Ensure that the corresponding commands have been successfully completed in your Snowflake instance.
      • For Password authentication:
        • Fill out the password field.
        • Copy the commands and run them within your Snowflake instance.
        • Be sure to fill out the password field in your command.
      • For Key Pair authentication:
        • Mixpanel will generate a secure key pair for your source per the Snowflake requirements.
        • The private key will be encrypted and stored securely, and used only when we need to communicate with your Snowflake instance.
        • Public key can be found in the suggested SQL to create your user.
  4. In the second view, you can click Create Source after completing the following:
    • Warehouse

      • Enter the name of your warehouse (default value: MIXPANEL_IMPORT_WAREHOUSE).

      • We recommend creating a separate warehouse for Mixpanel, and ensuring that Mixpanel has the appropriate role permissions to access it.

      • Run the commands below in Snowflake.

        CREATE WAREHOUSE MIXPANEL_IMPORT_WAREHOUSE WITH WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE INITIALLY_SUSPENDED = FALSE;
        GRANT USAGE ON WAREHOUSE MIXPANEL_IMPORT_WAREHOUSE TO ROLE MIXPANEL_IMPORT_ROLE;
        GRANT OPERATE ON WAREHOUSE MIXPANEL_IMPORT_WAREHOUSE TO ROLE MIXPANEL_IMPORT_ROLE;
        GRANT MONITOR ON WAREHOUSE MIXPANEL_IMPORT_WAREHOUSE TO ROLE MIXPANEL_IMPORT_ROLE; 
    • Storage Integration

      • This is required because Mixpanel will export the query results into a GCS bucket.
      • Default value: MIXPANEL_IMPORT_STORAGE_INTEGRATION
      CREATE STORAGE INTEGRATION MIXPANEL_IMPORT_STORAGE_INTEGRATION
        TYPE = EXTERNAL_STAGE
        STORAGE_PROVIDER = 'GCS'
        ENABLED = TRUE
        STORAGE_ALLOWED_LOCATIONS = ("gcs://mixpanel-2946576-ca470bce1e1ed2ec");
      GRANT USAGE ON INTEGRATION MIXPANEL_IMPORT_STORAGE_INTEGRATION TO MIXPANEL_IMPORT_ROLE; 
    • Database (optional)

      • Enter the name of the database you want to grant permission to.
      • By default, we request read-only access.
      • Mixpanel does not store the access information. However, you can choose to provide more granular access if you desire.
      GRANT USAGE ON DATABASE "<your_data_base>" TO ROLE MIXPANEL_IMPORT_ROLE;
      GRANT USAGE ON ALL SCHEMAS IN DATABASE "<your_data_base>" TO ROLE MIXPANEL_IMPORT_ROLE;
      GRANT SELECT ON ALL TABLES IN DATABASE "<your_data_base>" TO ROLE MIXPANEL_IMPORT_ROLE;
      GRANT SELECT ON ALL VIEWS IN DATABASE "<your_data_base>" TO ROLE MIXPANEL_IMPORT_ROLE;

IP Allowed List

If you are using Snowflake Network policy (opens in a new tab) to restrict access to your instance, you might need to add the following IP addresses to the allowed list.

34.31.112.201
34.147.68.192
35.184.21.33
35.225.176.74
35.204.164.122
35.204.177.251