A building with a digital ad showcasing people on roller skates and the tagline "Milk hydrates better than water."A building with a digital ad showcasing people on roller skates and the tagline "Milk hydrates better than water."

Bridging the gap
See BRAZE In Action

the brand icon

THE BRAND

Robert’s Pizza, a fictional brand famous for its bold, one-of-a-kind flavor combinations.

secret sauce icon

THE SECRET SAUCE

Liquid Scripting: Braze’s built-in tool that helped Robert’s Pizza create scalable, dynamic personalization across emails, push notifications, SMS, and more. No additional platform or tech implementation needed.

challenge icon

The Challenge

Robert’s Pizza needed more than just great toppings. They needed a fresh way to stand out, drive repeat orders, and create real emotional connections—all without adding extra strain on their team.

chessy diva badge

GAMIFIED
personalization
at scale

Liquid Scripting enabled Robert’s Pizza to send tailored badges to each customer based on their unique pizza preferences. For example, a customer who frequently orders extra cheese, pepperoni, and olives would receive a “Cheesy Diva” badge, while a vegetarian customer would get “The Plant-Based Royalty” badge.

badge logic icon

BADGE LOGIC

Each time a customer places an order, we evaluate it against a set of predetermined ingredients to calculate a personalized "taste profile" score. Here's how the scoring works:

Crust and Sauce Matches: +25 points each
Extras (like cheese, drizzle, etc.): +20 points each
Toppings (like veggie or meat): +10 points each

Each matching ingredient adds to the customer’s overall profile score, helping us track their flavor preferences over time, assign a badge and highlight the other sides of their pizza personality.

braze email campaign pie chart
braze sample pizza personalities icon

SAMPLE PIZZA PERSONALITIES

Let’s look at how Robert’s three most loyal customers, Larry, Moe, and Curly, score on their go-to orders.

Customer

Crust

Sauce

Extras

Toppings

Pizza Personality

Larry

Stuffed crust

White sauce

Parmesan sprinkle

Extra cheese, pepperoni,
bacon

45% Cheesy Diva
25% Truffle Trendsetter
10% Classic Legend
10% Meat Machine

Moe

Hand-tossed

Extra marinara

Everything bagel finisher

Pepperoni,
sausage,
bacon

55% Meat Machine
25% Cheesy Diva
10% Truffle Trendsetter

Curly

Pan crust

Traditional tomato

Vegan cheese

Mushrooms,
spinach,
tomatoes

60% Classic Legend
40% Plant-Based Royalty

how is made icon

HOW THE SAUSAGE IS MADE

In Braze, marketers have a few options for generating these scores, including Custom Events that can track user behavior over time and Nested Custom Attributes that can add JavaScript Object Notation (JSON) payload data directly to user profiles. For simplicity, we are going to use four Braze Custom Attributes, which will contain details on the customer’s order. In Braze, we will then create five custom variables named, “diva,” “action,” “plant,” “icon,” and “legend” to track user scores.

Then, we will assign the user’s Custom Attributes, “pizza_crust,” “pizza_sauce,” “pizza_toppings”, “pizza_extras.” Because a customer can have more than one item in both “pizza_toppings” and “pizza_extras,” those fields are created in Braze as Arrays, which allows Braze users to include more than one value within a single attribute. Figure 1 below shows these variable assignments in Liquid.

Figure 1: Braze Liquid Variable Assignments

{% assign diva = 0 %}
{% assign action = 0 %}
{% assign plant = 0 %}
{% assign icon = 0 %}

{% assign legend = 0 %}{% assign crust = {{custom_attribute.${pizza_crust}}} %}
{% assign sauce = {{custom_attribute.${pizza_sauce}}} %}
{% assign toppings = {{custom_attribute.${pizza_toppings}}} %}
{% assign extras = {{custom_attribute.${pizza_extras}}} %}

Now that all the scores are set to zero and we’ve got the customer’s latest order, we can start scoring. Remember, “pizza_toppings” is an array of data, so we will combine “for” statements with “if” statements to assess each item in the customer’s toppings list. For example, Figure 2 below contains a sample snippet that assesses two toppings, pepperoni and olives. We will assess user orders and increase the score where the customer has added either one or both of these ingredients. Because the Cheesy Diva, Action Hero, and Classic Legend all feature pepperoni, we have increased this customer’s score by 10 points for each of these profiles, respectively, if their toppings include pepperoni. Olives are strictly for Cheesy Divas, (who knew?), and so users ordering olives will gain 10 points on the “diva” scale.

Figure 2: Scoring with Conditional Statements

{% for obj in {{custom_attribute.${pizza_toppings}}} %}
 {% if obj == 'pepperoni' %}
   {% assign diva = diva | plus: 10 %}
   {% assign action = action | plus: 10 %}
   {% assign legend = legend | plus: 10 %}
 {% endif %}
 {% if obj == 'olives' %}
   {% assign diva = diva | plus: 10 %}
 {% endif %}
{% endfor %}

After we have gone through all attributes, it’s time to assess our winner. To do this, we are going to start with diva. After our assessment, “diva” will have an assigned score. Let’s make it 30 and we’ll mark it as the “highest”. Now let’s assign the customer an “action” score of 50. If we compare “action” to “highest,” we find that “action” should be the new highest, since 50 tops the current highest of 30. We’ll cycle through all scores until we have a winner. Here, ties go to the existing leader. Figure 3 below outlines this logic and assigns new variables that can be referenced in the body of each message.

Figure 3: Closest Pizza Profile

{% assign highest = diva %}
{% assign pizza_profile = 'diva' %}
{% assign pizza_pal = 'Cheezy Diva' %}

{% if action > highest %}
  {% assign highest = action %}
  {% assign pizza_profile = 'action' %}
  {% assign pizza_pal = 'The Meat Machine' %}
{% endif %}

{% if plant > highest %}
  {% assign highest = plant %}
  {% assign pizza_profile = 'plant' %}
  {% assign pizza_pal = 'Plant-Based Royalty' %}
{% endif %}

{% if icon > highest %}
  {% assign highest = icon %}
  {% assign pizza_profile = 'icon' %}
  {% assign pizza_pal = 'Truffle Trendsetter' %}
{% endif %}

{% if legend > highest %}
  {% assign highest = legend %}
  {% assign pizza_profile = legend %}
  {% assign pizza_pal = 'Classic Legend' %}
{% endif %}

Now we have our pizza profile, plus we have scores to indicate how close the customer’s order came to each profile. It’s time to get creative. Since all scripting above can be saved into a Content Block template, this code can be added to any email, SMS, push notification, or in-app message, or Braze Content Block with a single line of code, shown in Figure 4 below.

Figure 4: Pizza Profile Content Block

{{content_blocks.${pizza_profile}}}

braze email campaign

Connect With Us

Reach out for industry insights or an opportunity to work together.

*Required information

First name *

Please enter your first name.

Last name *

Please enter your last name.

Email address *

Please enter valid email address.

Company *

Please enter company name.

Role *

Please enter your role.

I’d like updates from GALE in my inbox