One of the things we’ve been analyzing at Help Scout recently is what paths individual companies take before signing up for a trial. For example, looking at a company that signed up last month, did they start their journey with Help Scout on our homepage? Or did they find us via our blog? Or one of our marketing landing pages? And once we know that, what other pages did they visit before signing up? Did that company wind up becoming a customer? How much did we make from them?
This post is about how we’ve wrangled the data using Mixpanel, Fivetran, BigQuery, and Looker to help us answer these questions.
Big picture, we’re tracking page view and sign up events in Mixpanel, syncing that data to BigQuery using Fivetran, then tying it to our internal company data in Looker for easy analysis.
Step 1: Tracking Page Views and Sign Ups in Mixpanel
If you’ve used an event-based analytics service, this step will be pretty straightforward. We load the Mixpanel script on every page, then fire a Viewed Page event:
And then if the company signs up for a trial, we fire a Signed Up event with that company’s id as a property:
These are the only two Mixpanel events we track. If we wanted to track actions in-app, we could also fire custom events for those, but we don’t at Help Scout because we tie this Mixpanel data together with our internal data about what companies have done in-app, eliminating the need for additional Mixpanel events.
Here’s what the Viewed Page event looks like in Mixpanel’s Live View:
Also as we’ll see later, Mixpanel automatically tracks a lot of details about the visitor: things like the browser, country, URL, referrer, OS, etc, all of which we can use use in our analyses.
Step 2: Syncing Mixpanel data to BigQuery with Fivetran
Fivetran is this amazing service that specializes in helping you centralize all of your data in a data warehouse. For example, we have Fivetran connectors set up for MySQL (which we use internally at Help Scout), Salesforce, HubSpot, Google Sheets, and now Mixpanel:
Taking Mixpanel as an example, we provide Fivetran out Mixpanel API credentials, then Fivetran queries Mixpanel’s API periodically, cleans up the results, and throws it all in BigQuery:
This lets us analyze our Mixpanel data just like we would other SQL data:
We can also access the custom event properties that we’re tracking for the Signed Up event using Standard SQL’s json_extract_scalar function:
Once we have the company id, it’s just a matter of querying for a specific company id to view their event history:
Step 3: Modeling the data in Looker
If you have access to a Business Intelligence tool like Looker, you can model this Mixpanel data and how to join it with your other data.
First, create a view to model the Mixpanel event data:
Then create a view with a derived table to model the relationship between a distinct_id in Mixpanel with a company id:
Finally, connect those two views and any others you want to be able to analyze together:
Step 4: Analyzing the data in Looker
Once you’ve modeled the data, you can analyze the event history for specific companies, track trends like page views and unique visitors, and more:
In future posts I’ll walk through some of the other interesting analyses you can perform with this data.
If you have any questions about this setup, don’t hesitate to reach out.