Skip to main content
    Quick Guide
    5 min read

    Create custom events to send weekly restaurant specials

    Learn how to write custom events in Klaviyo so you can capture all the data you need, even without a pre-built integration event.

    Send out restaurant specials

    In this example, learn about how the Klaviyo Cafe set up a custom system to send weekly restaurant specials to local diners. The Klaviyo Cafe has a flagship restaurant in Boston, but they recently expanded to New York, Philadelphia, and Providence, RI.

    Each location has its own regional specialties, and the managers of each branch create a seasonal menu of specials every week. The Klaviyo Cafe wants to keep track of when customers dine in each location and send weekly specials to customers who frequent each location.

    Set up data with the end goal in mind

    Read through the dropdowns below to see how the Klaviyo Cafe worked through the 4-step framework to reach their end goal.

    Identify the end goal and requirements

    The Klaviyo Cafe's end goal is to send weekly restaurant specials specific to each customer's dining location.

    The requirements for this are:

    • A message sent every week
    • An audience to send the message to

    The requirements for the audience are:

    • Each message should only be sent to customers who recently dined at a specific location
    • Customers need to have opted in to SMS
    What data do you have access to?

    When customers dine at the Klaviyo Cafe, they provide the brand with a lot of useful information.

    The following information is stored in the Klaviyo Cafe's restaurant management system:

    • When and how frequently each customer dines in
    • What location they dine at
    • The total cost of each meal
    • What each customer ordered

    The following information is stored in Klaviyo:

    • Each customer's consent status
    • Each customer's contact information
    • A record of the messages each customer receives and how they interact with them

    Identifying where each piece of data exists helps the Klaviyo Cafe determine where they need to send certain pieces of data.

    How should the data be structured?

    Recall that to send the appropriate message, the Cafe needs a message and an audience to send it to.

    Message

    To send a message, the Cafe team needs to identify which message type and channel to use.

    Message type
    • Campaigns are best for one-time sends, while flows are great to send messages in response to customer actions or specific dates.
    • The goal is to send a message to everyone at a specific time. Therefore, a campaign is best.
    Message channel
    • Klaviyo can send emails, SMS messages, and push notifications
    • The Cafe opts for SMS over email to ensure the specials are seen quickly

    Audience

    The ideal audience for the weekly restaurant special campaigns is a group of customers who:

    • Recently dined at a specific location
    • Are consented to receive SMS messages

    We can create a segment to identify these customers:

    In order to create this segment, we need a way to get dining information, including location, into Klaviyo. Customers can dine at a restaurant multiple times, and the Cafe wants to maintain a record of all the times customers dined in. Therefore, they can create a custom event that will fire every time a customer dines in.

    They can then use location data from this event to inform the segment of customers. Note that segments can only look at top-level data. Any data they wish to use to create segments, such as location data, should not be nested within any other event data.

    This Ate at restaurant event will fire anytime customers dine at the Klaviyo Cafe going forward. The Cafe also uploads a record of customers who have dined in the past by importing historical event data.

    Identify the API endpoint(s)

    The data the Klaviyo Cafe needs is stored in their restaurant management system. In order to get that data into Klaviyo, they'll want to use the Create Event endpoint and include all the relevant data in a custom Ate at restaurant event.

    Recall that location needs to be top-level within the properties object for use in segmentation.

    Send a message to the right customers

    Now that the Klaviyo Cafe has moved through the 4-step framework, let's put it all together!

    First, they use theCreate Event endpoint to send a custom Ate at restaurant event.

    Then, they can create a segment based on this event with the added condition of being consented to SMS marketing. This will automatically gather all customers who should receive the weekly special message.

    Finally, they can create and schedule an SMS campaign to send to this segment.

    The Klaviyo Cafe can even further extend this and fully customize the customer experience based on what each customer ordered, their reviews of the restaurant, and more.

    Want to learn more?

    Take our Academy course, Map your data into Klaviyo, for more examples and a detailed explanation of the framework used here to map data.

    Create custom events to send weekly restaurant specials
    Back to all resources