Use Cases

Forward customer data to Snowflake for analysis and storage


Handling data ingestion with a CDP then forwarding this information to a Data Warehouse for analysis and long term storage is an effective strategy for taking advantage of the unique capabilities that both of these tools offer. With your customer data stored in a Data Warehouse like Snowflake, for instance, you can easily query historic data to gain longitudinal insights about your customers, and combine your customer data with information from many other sources. 

In this use case, we will explore how to collect eCommerce customer data with mParticle, forward this data from mParticle to Snowflake, then query the data to retrieve targeted customer segments for analysis and activation.

Step 1: Integrate mParticle’s SDK into your eCommerce client

The first step is to implement event collection code throughout your eCommerce app using mParticle’s SDKs. When doing this, we recommend starting with a Data Plan. This blog post covers best practices for aligning stakeholders on developing a data plan using mParticle’s Data Plan Builder.

Step 2: Set up your warehouse, database, and schema in Snowflake

Next, you will need to instantiate a warehouse, database and schema within Snowflake where you will eventually forward your eCommerce data. You can easily accomplish this by running some SQL commands within a Snowflake Worksheet:

Step 3: Create roles and manage user permissions

Now you’ll need to create a role with permissions to manage the database you just created within Snowflake, again by running direct SQL commands:

Step 4: Enable the Snowflake integration within mParticle

In your mParticle workspace, select “Data Warehouses” under “Setup” in the navigation menu. Select Snowflake, then click on the plus icon to name and add a new Snowflake configuration. 

With the “Settings” tab of your Snowflake configuration, enter the database, warehouse, and schema names you created in Snowflake, along with the user ID and password you set for your dedicated user. Within this “Settings” screen, you’ll also supply an event threshold, which tells Snowflake to create a dedicated table once it receives a specified number of events of the same type, as well as a loading delay, which lets you adjust how often you want to forward your event batches to Snowflake. 

Finally, connect individual inputs in mParticle to your Snowflake output from within the Connections page. Since we will be forwarding events from the eCommerce app that we connected to mParticle in step 1, you will select the “Web” input here. 

Step 5: Verify your data connection in Snowflake

Once Snowflake has received its first event batch from mParticle, you will see this data represented as tables and views within your Snowflake schema.

Step 6: Query your data to retrieve targeted audiences

Now that our eCommerce data is being forwarded to Snowflake, we can write SQL queries directly within our Snowflake Worksheet to retrieve targeted customer segments. In this example, let’s assume that our product team has an educated hypothesis that customers who select red couches have a higher than average likelihood to make repeat purchases. Since we are logging an “Add Customization–Color” event in mParticle and forwarding these events to Snowflake, we can easily pull this audience with a simple SQL query.

Running a SQL query in Snowflake to retrieve a targeted audience for engagement

Excellent! Since we were capturing email as a user attribute along with these events, we can now export this targeted audience as a CSV that will allow our marketing team to contact these customers with targeted offers. Additionally, since we more than likely have customer email identifiers in data sets from other sources, we have the option of running JOIN statements to combine this data set with information from other sources stored across our Data Warehouse.

Watch an end-to-end demo of this use case:

Get started today

Try out mParticle and see how to integrate and orchestrate customer data the right way for your business.

Sign upContact us

Startups can now receive up to one year of complimentary access to mParticle. Learn more