Setting up product analytics in Snowflake
Overview
This topic explains how to set up LaunchDarkly product analytics in Snowflake.
To set up product analytics, you must first connect LaunchDarkly’s Snowflake Native Product Analytics integration to import event and other data to LaunchDarkly. To do this, you provide some information to connect your Snowflake account to LaunchDarkly.
Prerequisites
Before completing this procedure, you must have the following prerequisites:
- You should be tracking event data in your application
- An active Snowflake account with the
SECURITYADMIN
andSYSADMIN
privileges - Access to Snowflake
Set up product analytics with Snowflake
There are two ways to set up product analytics with Snowflake:
- Using the Snowflake Data Export destination
- Using a third-party customer data platform (CDP) to import your own events
Click to expand Using the Snowflake Data Export destination
Using the Snowflake Data Export destination
To use LaunchDarkly product analytics, you must first enable LaunchDarkly’s Snowflake Native Product Analytics integration. Here’s how:
- Click Product analytics in the left navigation, or find it by searching “Snowflake product analytics” on the Integrations page.
- Click Configure. The “Configure Snowflake Product Analytics” menu opens.
- Click Manage integration. The “Configure Snowflake Native Product Analytics” menu opens.
- Choose Using LaunchDarkly SDK and click Next step. If you have not yet configured Data Export, you will be prompted to do so. Then, the “Configure Snowflake Native Product Analytics” menu opens.
- Enter a human-readable Name.
- Enter your Snowflake account URL. You can find this in Snowflake’s “Account” menu, in the “Account/Server URL” field.
After you complete the steps above, LaunchDarkly generates a SQL script to connect your Snowflake account to LaunchDarkly. In the “Configure Snowflake Native Product Analytics” menu:
- Copy the script and paste it into a new worksheet in your Snowflake account.
- Run the script in Snowflake. When it completes, return to LaunchDarkly.
- Read the “Integration Terms and Conditions,” and then select the checkbox to acknowledge them.
- Click Save configuration. A confirmation message appears at the top of the screen when configuration completes successfully.
Click to expand Using a third-party customer data platform (CDP) to import your own events
Using a third-party customer data platform (CDP) to import your own events
To use LaunchDarkly product analytics, you can also import your own events from a third-party customer data platform (CDP). Here’s how:
- Click Product analytics in the left navigation, or find it by searching “Snowflake product analytics” on the Integrations page.
- Click Configure. The “Configure Snowflake Product Analytics” menu opens.
- Click Manage integration. The “Configure Snowflake Native Product Analytics” menu opens.
- Choose Use CDP/Custom SDK and click Next step. The “Configure Snowflake Warehouse” menu opens.
- Enter a human-readable Name.
- Enter your Snowflake account URL. You can find this in Snowflake’s “Account” menu, in the “Account/Server URL” field. This generates a
public_key
andproject_env_key
. Save these values for use in the script below.
Configure your custom SDK or CDP to send events to a table in your Snowflake project. These events must be transformed to match LaunchDarkly’s required schema in an ALLEVENTS
table or a view. Here is the structure to use:
Now, use the code below to configure your CDP or custom SDK to connect to LaunchDarkly product analytics.
Use the dataset you created in the previous procedure as the destination for the ALLEVENTS
table.
After you create the ALLEVENTS
table, run the following commands to enable change tracking:
If you have created an ALLEVENTS
view instead of a table, then run the following commands to enable change tracking:
In the “Configure Snowflake warehouse” menu:
- Return to the “Configure Snowflake Native Product Analytics” in LaunchDarkly.
- Read the “Integration Terms and Conditions,” and then select the checkbox to acknowledge them.
- Click Save configuration. A confirmation message appears at the top of the screen when configuration completes successfully.
After you complete the setup steps, the landing page on the Product analytics screen in LaunchDarkly will update to show a “Waiting for data…” status. Events and other information will begin to populate the screen within 15 minutes. Events from the last 30 days will be available within an hour. Load time varies based on the volume of data you’re importing from Snowflake.
To verify that data is loading, refresh the page. The Dashboards tab will not have any information in it until you create a dashboard, but you can confirm that setup was successful by checking the Events and Attributes tabs. After the import completes, both of those tabs display pre-populated data.
After the event data appears, you will be able to access different aspects of the product analytics UI.
To learn more, read Dashboards, Events, Cohorts, and Attributes.