Skip to main content

Snowflake

Snowflake

DirectionBidirectional
Environment
WebiOSAndroidCTVAPI Direct
Capability
ConnectivityRouting
SDK RequiredNo
Product(s) Required
Core PlatformRouting

Snowflake provides a cloud data platform where publishers can unify and analyze audience and advertising data securely.

Overview

The Snowflake integration enables publishers to leverage Permutive’s bi-directional data capabilities with their Snowflake data warehouse. This integration operates in two modes: Routing (Destination): Stream first-party event data from Permutive to Snowflake. Read more in Routing documentation.
Routing capability requires the Routing package in addition to Core Platform. Contact your Customer Success Manager to enable Routing.
Connectivity (Source): Import audience data from your Snowflake warehouse into Permutive for cohort building and activation across your publisher inventory. Use cases include:
  • Unifying first-party audience data with advertising and CRM data in Snowflake
  • Building a single view of your audience by combining Permutive data with other data sources
  • Creating segments and insights in Snowflake for activation in Permutive
  • Running custom analytics and reporting on raw Permutive event data

Environment Compatibility

EnvironmentSupportedNotes
WebYes
iOSYes
AndroidYes
CTVYes
API DirectYes

Prerequisites

For Routing (exporting data to Snowflake):
  • Active Snowflake account with appropriate permissions
  • Ability to create database, schema, tables, stages, and pipes in Snowflake
  • Ability to create users with key-pair authentication (password authentication is not supported)
  • Access to a Snowflake warehouse for data loading operations
  • Snowflake account URL in the format: https://<organization-id>-<account-id>.snowflakecomputing.com

Setup

Setting up Snowflake routing involves creating a dedicated database, schema, user, and role in your Snowflake instance, then configuring key-pair authentication so Permutive can stream event data via Snowpipe. Once configured, Permutive will complete the storage integration and begin streaming data automatically.

Prerequisites

  • Active Snowflake account with administrative permissions
  • Ability to create databases, schemas, users, roles, and storage integrations
  • Access to a Snowflake warehouse
  • Snowflake account URL in the format: https://<organization-id>-<account-id>.snowflakecomputing.com
Snowflake Routing requires key-pair authentication. Password authentication is not supported.
For the complete step-by-step setup guide with SQL scripts and permissions configuration, see Setting Up Snowflake Routing.

What Happens After Setup

Once routing is active:
  1. Tables are created automatically for events, aliases, and segment metadata
  2. Events stream via Snowpipe in approximately 5-minute or 500MB batches
  3. All event types appear in a single EVENTS table with an EVENTNAME column to distinguish types
  4. Schemas update automatically when you add new event types or properties

Data Types

When Routing is enabled, Permutive creates the following tables in your Snowflake instance to store event data and metadata:
The main events table contains all user interaction data collected by Permutive.
TIME
TIMESTAMP
The timestamp when the event occurred.
ORGANIZATIONID
VARCHAR
Your Permutive organization identifier.
PROJECTID
VARCHAR
The workspace (project) ID where the event was collected.
VIEWID
VARCHAR
Unique identifier for the page view session.
SESSIONID
VARCHAR
Unique identifier for the user session.
USERID
VARCHAR
The Permutive user identifier.
EVENTID
VARCHAR
Unique identifier for this specific event.
EVENTNAME
VARCHAR
The name/type of the event (e.g., PageView, Pageview, SlotViewable).
SEGMENTS
ARRAY
Array of segment IDs (integers) that the user belongs to at the time of the event.
PROPERTIES
OBJECT
JSON object containing event-specific properties and metadata. Structure varies by event type.
Contains user identity synchronization data for cross-device and cross-context tracking.
TIME
TIMESTAMP
The timestamp when the alias sync occurred.
EVENT_TYPE
VARCHAR
Type of sync event (e.g., “alias_sync”).
PERMUTIVE_ID
VARCHAR
The Permutive user identifier.
WORKSPACE_ID
VARCHAR
The workspace (project) ID.
ID
VARCHAR
The external identifier being synced (e.g., hashed email, device ID).
TAG
VARCHAR
The type/tag of the external identifier (e.g., “email_sha256”, “device_id”).
Metadata table containing information about segments configured in your Permutive workspace.
INSERTED_AT
TIMESTAMP
When the segment metadata was inserted/updated in Snowflake.
WORKSPACE_ID
VARCHAR
The workspace (project) ID.
NAME
VARCHAR
Human-readable name of the segment.
TAGS
ARRAY
Array of tags associated with the segment.
METADATA
OBJECT
JSON object containing additional segment metadata (e.g., description, creation date).
NUMBER
VARCHAR
The segment ID number as a string.

Troubleshooting

Symptoms: No data visible in the EVENTS table after completing Routing setup.Solutions:
  1. Wait at least 5-10 minutes after setup completion for initial data flow
  2. Verify Snowpipe is running:
    SHOW PIPES IN SCHEMA PERMUTIVE.DATA;
    
  3. Check pipe status - it should show as “RUNNING”
  4. Verify the storage integration was created successfully:
    SHOW INTEGRATIONS;
    
  5. Contact Support if no data appears after 15 minutes
Symptoms: Authentication failures when connecting to Snowflake, errors like “Invalid key” or “Authentication failed”.Solutions:
  1. Ensure the private key is in PKCS8 PEM format:
    openssl pkcs8 -topk8 -inform PEM -in old_key.pem -out new_key.p8 -nocrypt
    
  2. When setting RSA_PUBLIC_KEY on the Snowflake user, ensure you:
    • Remove the -----BEGIN PUBLIC KEY----- header
    • Remove the -----END PUBLIC KEY----- footer
    • Concatenate all remaining lines into a single string (no line breaks)
  3. Verify the public key is correctly attached to the user:
    DESC USER permutive_routing;
    
    Check the RSA_PUBLIC_KEY_FP field is populated
  4. If using an existing key pair, regenerate a fresh key pair following the setup instructions
Symptoms: Errors indicating insufficient permissions when Permutive attempts to create tables, stages, or pipes.Solutions:
  1. Verify the role has all required permissions:
    SHOW GRANTS TO ROLE permutive_routing_role;
    
  2. Ensure the following grants are present:
    • USAGE on database
    • USAGE, CREATE TABLE, CREATE STAGE, CREATE PIPE on schema
    • CREATE INTEGRATION on account
    • OPERATE on future pipes
    • USAGE on warehouse
  3. If any grants are missing, re-run the permission grant commands from the setup guide
  4. Ensure the user’s default role is set correctly:
    ALTER USER permutive_routing SET DEFAULT_ROLE = permutive_routing_role;
    

Changelog

No changes listed yet. For detailed changelog information, visit our Changelog.