Best Practices

(Pt 3) Right time: Triggering time-sensitive emails with event data in HubSpot

Jeff Sloan
Jeff Sloan September 26, 2023

Jeff is a Senior Data Community Advocate at Census, previously a Customer Data Architect and a Product Manager. Jeff has strong opinions on LEFT JOINs, data strategy, and the order in which you add onions and garlic to a hot pan. Based in New York City.

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: 

  1. Right person by segmenting users based on trial activity (inactive v active) 
  2. Right message by personalizing a free trial report with usage data 
  3. 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: 

  1. People (“Contacts” in Hubspot-speak), and attributes about them 
  2. Lists of people
  3. 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: 

  1. Create an automated email campaign in HubSpot and publish it
  2. Create a custom behavioral event in HubSpot associated with Contacts
  3. Create a Workflow to trigger the email campaign when a contact’s custom behavioral event is received in HubSpot
  4. Segment our total list of events in Snowflake using Census so that we’re only sending the event we care about (“add image”)
  5. Sync the “add image” event from Snowflake to HubSpot using Census
  6. 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.

Related articles

Customer Stories
Built With Census Embedded: Labelbox Becomes Data Warehouse-Native
Built With Census Embedded: Labelbox Becomes Data Warehouse-Native

Every business’s best source of truth is in their cloud data warehouse. If you’re a SaaS provider, your customer’s best data is in their cloud data warehouse, too.

Best Practices
Keeping Data Private with the Composable CDP
Keeping Data Private with the Composable CDP

One of the benefits of composing your Customer Data Platform on your data warehouse is enforcing and maintaining strong controls over how, where, and to whom your data is exposed.

Product News
Sync data 100x faster on Snowflake with Census Live Syncs
Sync data 100x faster on Snowflake with Census Live Syncs

For years, working with high-quality data in real time was an elusive goal for data teams. Two hurdles blocked real-time data activation on Snowflake from becoming a reality: Lack of low-latency data flows and transformation pipelines The compute cost of running queries at high frequency in order to provide real-time insights Today, we’re solving both of those challenges by partnering with Snowflake to support our real-time Live Syncs, which can be 100 times faster and 100 times cheaper to operate than traditional Reverse ETL. You can create a Live Sync using any Snowflake table (including Dynamic Tables) as a source, and sync data to over 200 business tools within seconds. We’re proud to offer the fastest Reverse ETL platform on the planet, and the only one capable of real-time activation with Snowflake. 👉 Luke Ambrosetti discusses Live Sync architecture in-depth on Snowflake’s Medium blog here. Real-Time Composable CDP with Snowflake Developed alongside Snowflake’s product team, we’re excited to enable the fastest-ever data activation on Snowflake. Today marks a massive paradigm shift in how quickly companies can leverage their first-party data to stay ahead of their competition. In the past, businesses had to implement their real-time use cases outside their Data Cloud by building a separate fast path, through hosted custom infrastructure and event buses, or piles of if-this-then-that no-code hacks — all with painful limitations such as lack of scalability, data silos, and low adaptability. Census Live Syncs were born to tear down the latency barrier that previously prevented companies from centralizing these integrations with all of their others. Census Live Syncs and Snowflake now combine to offer real-time CDP capabilities without having to abandon the Data Cloud. This Composable CDP approach transforms the Data Cloud infrastructure that companies already have into an engine that drives business growth and revenue, delivering huge cost savings and data-driven decisions without complex engineering. Together we’re enabling marketing and business teams to interact with customers at the moment of intent, deliver the most personalized recommendations, and update AI models with the freshest insights. Doing the Math: 100x Faster and 100x Cheaper There are two primary ways to use Census Live Syncs — through Snowflake Dynamic Tables, or directly through Snowflake Streams. Near real time: Dynamic Tables have a target lag of minimum 1 minute (as of March 2024). Real time: Live Syncs can operate off a Snowflake Stream directly to achieve true real-time activation in single-digit seconds. Using a real-world example, one of our customers was looking for real-time activation to personalize in-app content immediately. They replaced their previous hourly process with Census Live Syncs, achieving an end-to-end latency of <1 minute. They observed that Live Syncs are 144 times cheaper and 150 times faster than their previous Reverse ETL process. It’s rare to offer customers multiple orders of magnitude of improvement as part of a product release, but we did the math. Continuous Syncs (traditional Reverse ETL) Census Live Syncs Improvement Cost 24 hours = 24 Snowflake credits. 24 * $2 * 30 = $1440/month ⅙ of a credit per day. ⅙ * $2 * 30 = $10/month 144x Speed Transformation hourly job + 15 minutes for ETL = 75 minutes on average 30 seconds on average 150x Cost The previous method of lowest latency Reverse ETL, called Continuous Syncs, required a Snowflake compute platform to be live 24/7 in order to continuously detect changes. This was expensive and also wasteful for datasets that don’t change often. Assuming that one Snowflake credit is on average $2, traditional Reverse ETL costs 24 credits * $2 * 30 days = $1440 per month. Using Snowflake’s Streams to detect changes offers a huge saving in credits to detect changes, just 1/6th of a single credit in equivalent cost, lowering the cost to $10 per month. Speed Real-time activation also requires ETL and transformation workflows to be low latency. In this example, our customer needed real-time activation of an event that occurs 10 times per day. First, we reduced their ETL processing time to 1 second with our HTTP Request source. On the activation side, Live Syncs activate data with subsecond latency. 1 second HTTP Live Sync + 1 minute Dynamic Table refresh + 1 second Census Snowflake Live Sync = 1 minute end-to-end latency. This process can be even faster when using Live Syncs with a Snowflake Stream. For this customer, using Census Live Syncs on Snowflake was 144x cheaper and 150x faster than their previous Reverse ETL process How Live Syncs work It’s easy to set up a real-time workflow with Snowflake as a source in three steps: