How We Hacked Email Notifications into Klaviyo

MHDG Staff Marketing Automation, Operations

Klaviyo is a email marketing platform built primarily for B2C businesses, as it’s got fantastic integrations with platforms like Shopify and a really good flow builder. To us, it’s one of the platforms that perfectly balances out of the box features and intuitive design, while still having the horsepower behind it to do more complicated logic at a very affordable price.

But because it’s primarily a B2C platform well suited for ecommerce stores, the need for internal email notifications isn’t quite there for most accounts. But what about the accounts who have high priced items that often require reassurance from the sales team for a buyer to make the purchase, or distributors looking to contact the team to source their products?

Without internal notifications, these contacts get treated like any other buyer in Klaviyo, and it would require a separate platform to manage them from end to end, or to watch Klaviyo all day for particular form submissions. Rather than have to use another tool to handle notifying the sales team about B2B-esque inquiries, we took action using Klaviyo’s easy to use custom event triggers – and Zapier – to handle these contacts.

In this example, we’ll demonstrate how we set it up using the ‘Contact Us’ form on our own site.

First, we need to create and send a custom event to Klaviyo when a particular form is submitted. By default, a form submission in Klaviyo does not create an event, but using their documentation, we can add a custom javascript event to the form submission. For you non-technical marketers out there, we promise it’s not as scary as it sounds.

With guidance from Klaviyo’s documentation and just a bit of javascript logic, we simply dropped this on the pages that have our Contact Us form:

<script>
window.addEventListener("klaviyoForms", function(e) {
if (e.detail.type == 'submit' || e.detail.type == 'redirectedToUrl') {
if (e.detail.formId == 'NiXCM7') {
_learnq.push(['track', 'Submitted Contact Form', {
'formId' : e.detail.formId
}
]);
}
}
});
</script>

then, did a simple test submission to see that the event successfully made it to Klaviyo:

Success!

Now that we have this custom event triggered, we can make use of Klaviyo’s integration with Zapier to send us a notification that someone submitted the form.


Unfortunately, Klaviyo only has a generic trigger for a new event, and with events getting triggered when a known contact is ‘Active on Site’ (a standard event), we needed to filter those events out and focus only on the ‘Submitted Contact Form’ event – but, we can use Zapier’s built-in Filter action to do this for us.

In addition to sending us an email notification, we included the action of creating a Lead in our CRM, Streak. In the Zap action, we’re able to pass the First, Last, Company Name, and Project Description right through from the form into our CRM.

And now finally, we used the Gmail action to send an email to our catch-all address, which is auto-forwarded to the business partners that also contains the information collected in the form and a subject line of ‘New Lead!’

There you have it!

Rather than use yet another platform to handle B2B type inquires in an otherwise B2C business, we were able to use Klaviyo’s flexible custom events along with a simple Zap to pass our B2B type leads into a CRM, and send an internal notification to the team to handle and reach out to the lead.