(Pt 3) Right time: Triggering time-sensitive emails with event data in HubSpot
Jeff SloanSeptember 26, 2023
Jeff is a Product Manager at Census with deep interests in analytics engineering, remote work, and cooking with sumac. New York City Metropolitan Area
In parts one and two of this three-part HubSpot marketing series, we learned about the importance of reaching the right people with the right message in marketing.
Now - it’s time to round out the marketing trilogy by discussing why timing is essential to successful marketing campaigns. We'll also explore how data and marketing teams can come together to ensure they’re reaching users at exactly the right moment.
To recap, here are the revenue-driving HubSpot use cases we’ve covered in this series:
Right time by emailing users about upgrading just after they attempt a paid feature 👈 We’re here!
All three use cases in this series are powered by data you already have in your warehouse and directly impact revenue. Below - we’ll walk through how to trigger trial emails based on actions users take in the product by stitching together our event and user data in HubSpot.
Note: If you’re a marketer reading this who wants to build campaigns off of custom behavioral events and product data, send your data person this article.
Before we get into our walkthrough, let’s take a look at the data we’ll need in HubSpot. 👇
Providing HubSpot with the data it needs: Custom Behavioral Events
Just jumping into the series with this use case? Check out part one for a breakdown of why “right person, right message, and right time” personalization is important for data-driven marketing.
Powering revenue-driving use cases for your marketing team uses product data you already have in your warehouse. It’s just a matter of activating it in HubSpot (or your CRM of choice).
As a reminder - we’ve been referencing three types of data points in our series:
People (“Contacts” in Hubspot-speak), and attributes about them
Lists of people
Actions that people have taken (events)
For this use case, we’ll once again help our friends at the imaginary SaaS company Marker with their marketing needs, this time focusing on using events to trigger emails to free trial users. In HubSpot, you can track custom actions by setting up Custom Behavioral Events, which can then be used in Workflows to trigger Automated Email Campaigns.
To reach our trial users at the right time, we’ll need HubSpot to be aware of key actions that indicate a free trial user may be interested in purchasing a subscription.
Reaching them a day or a week late can mean the difference between making them a customer or losing them to a competitor.
Practical example: Send personalized emails to free trial users when they use a paid feature
OK - now that we’ve discussed why the right timing matters for a marketing campaign, let’s get hands-on with our example for Marker.
Marker offers a productivity tool that lets users create virtual whiteboards called canvases and share those files with their colleagues for better collaboration. They offer a freemium product, with a 14-day trial of paid features when the user initially signs up. Naturally, Marker wants to convert as many of these free trials into paying subscribers as possible.
In Marker’s case, sharing canvases is included in the free product offering, but enhancing those layouts with images downloaded online is a paid feature. This feature will not continue to be available to free trialers unless they upgrade to a paid subscription.
Marker’s marketing team wants to send an email encouraging an upgrade once free trialers start using the “add image” paid feature, and they need HubSpot to know when someone uses the feature.
To do this, we’ll go through six steps:
Create an automated email campaign in HubSpot and publish it
Create a custom behavioral event in HubSpot associated with Contacts
Create a Workflow to trigger the email campaign when a contact’s custom behavioral event is received in HubSpot
Segment our total list of events in Snowflake using Census so that we’re only sending the event we care about (“add image”)
Sync the “add image” event from Snowflake to HubSpot using Census
Confirm that the “add image” behavioral event is correcty received in HubSpot to trigger emails ⏱️
By the end of the article - you’ll be up and running with a scheduled sync that gives your marketing team all the data they need to drive revenue by increasing your trial > paid plan conversions. 💰
Let’s dive in (and check out the video below if you prefer to learn that way instead) 👇
Note: I’ll show you how to do this with HubSpot, Snowflake, and Census. Alternatively to Census, I recommend using the HubSpot API for a DIY data pipeline from your 1st-party data sources, but the development and maintenance overhead will take longer than you’d expect. Feel free to reach out if you’d like to learn more.
Step one: Create our email in HubSpot
We’ll start by creating the email we want to send to our trial users after they attempt to use our “Add image” paid feature. Go ahead and set up an automated email in HubSpot (and have your marketing team drop in the copy to get folks excited about the product + encourage an upgrade).
Step two: Set up our custom behavioral event
Next, we need to create our custom behavioral event in HubSpot, associated with the Contact record. HubSpot requires you to create an event type before you send any data for this event. This step helps improve the quality of data that HubSpot ingests, but adds an extra step to the setup process.
For our example, we’ll create a custom behavioral event called “Add image”. Take note of the “internal_name” value for your event. You’ll need it later in Step 5.
Step three: Create workflow automation and add our email
Next - we’ll want to create a workflow in HubSpot that will send our email when HubSpot receives the custom behavioral event we created in Step 2. The workflow trigger will be our “Add image” event - and we’ll choose the automated email we created in Step 1 as the action to follow.
Turn the workflow on.
Step four: Identify our “Add image” event in Census
Time to jump over to Census to generate the Snowflake dataset that contains just this “Add image” event for our users.
First - make sure that you have HubSpot and Snowflake connected to Census. We can then tell Census which table is the “events” table holding data about actions taken in the Marker product.
We’ll then create a new segment, filtering for our “add image” event. After applying the filter, you’ll see the number in the segment go down to indicate that we’ve filtered out events that don’t meet our criteria.
Step five: Set up our first sync of the “Add image” event
Tab over to the sync tab and we’ll create our sync to HubSpot.
We’ll be creating a sync to send our “Add image” event to the custom behavioral event endpoint in HubSpot. First, we’ll want to specify the unique value for each event so we’re not double counting any of them.
Then - we’ll pass a few parameters from HubSpot. The first is the "internal name" for the event, which HubSpot requires as part of its API call. Go to the “Add image” event we created in HubSpot and copy the "internal name" from that page into the corresponding field in Census.
We’ll then map our user IDs (email) and the timestamp of the event (occured_at) before checking the “backfill all records” box. If you don’t want to email your users for behavior they performed in the past, leave this box unchecked, and Census will only send events added to the dataset moving forward.
From here, we can set up the sync to run for the first time!
While the first sync completes, we can set up a schedule to make sure these events are regularly sent to HubSpot from Snowflake in the future. You can choose whatever interval makes the most sense based on your needs and how frequently your data in Snowflake is updated. For this example, we’re going with hourly.
Step six: Send the right message at the right time to the right people
It’s time for the magic ✨ Let’s confirm that these behavioral events are associated to the right contacts, so that an email is triggered.
As the sync runs, we can see some of the events we’ve already sent to HubSpot. By going over the API inspector in Census, you can check to see which contact’s event was recently synced by grabbing the Contact ID from the request body view (user 5871 in this example).
Jump over to HubSpot and open one of your recent contacts. Replace the last string of numbers in the URL with the Contact ID, and you’ll see the user in HubSpot – including any events now associated with the record.
And that’s it! We’ve successfully sent in-trial activity data to HubSpot to trigger an email at the right time to convince a user to upgrade. 🙌
The revenue-generating power of personalized emails
When you align your work as a data team to the work of the marketing team, you don’t just make new cross-functional friends. You demonstrate the power of the data function to impact revenue.
As restrictions around cookies become more strict, marketers will rely more heavily on first-party data to build effective campaigns. As a data professional, you have an opportunity to furnish your marketers with the best, most complete first-party data in your data warehouse to drive revenue.
Thankfully, you have all the data you need to succeed - you just need to activate it, easily and at scale.
If you’re ready to explore how you can directly impact the business (and solve interesting problems with your data), check out Census.
And, if you want to dive deep into the right person, right message, and right time framework, check out my hands-on ConCensus 2023 workshop here.