Klaviyo recipe

Portico leads and rewards into Klaviyo.

Portico has no native Klaviyo connector. This recipe takes each signed webhook event into Klaviyo through Zapier's Klaviyo app, Make or a small endpoint of your own: a player who leaves their details becomes a profile, joins your list only when they said yes to marketing, and every reward, redemption and quiz score arrives as a Klaviyo event your flows can trigger on.

Discuss your campaign
01

Before you start

You need a brand on the Brand or Group plan, where webhooks and identified embeds are included, a Klaviyo account with API access or a Zapier or Make account, and the brand's webhook secret from the Portico console (Integrations). Portico posts to public https URLs only, never follows a redirect, and sends each event as JSON with the headers x-portico-event (the type), x-portico-delivery (the delivery's id) and x-portico-signature. Every key is always present, with null where the event has no value, so a mapping made from the sample works on every real event. A brand may have up to ten endpoints; one per automation is the usual pattern.

02

Which event goes where

Four of Portico's six events carry what a CRM wants: lead.captured when a player leaves their details, reward.awarded when they win, reward.redeemed when the code is used at your till or checkout, and quiz.completed when a quiz is scored. (calculator.completed and prediction.settled follow the same envelope.) Each event names the campaign, the participant, the session and the form's answers under the CRM names you chose, then its own block. This is how they land in Klaviyo.

Portico eventKlaviyo callWhat it records
lead.capturedCreate or update the profile by email (Klaviyo Profiles API, or Zapier's Create or Update Profile).email, phone_number, first and last name, and each answer as a profile property.
lead.captured, with marketingConsent trueSubscribe the profile to your list with email marketing consent (Klaviyo's subscription job, or Zapier's Subscribe Profile to List).The consent, its time from occurredAt, and the list membership your flows start from.
reward.awardedCreate an event with a metric name of your choice, such as Portico Reward Awarded (Klaviyo Events API, or Zapier's Create Event).reward.label, reward.tierKey, campaign.slug as properties; Portico's id as the event's unique_id, so a retry never makes a second event. The code only if your endpoint includes codes.
reward.redeemedCreate an event, such as Portico Reward Redeemed.redemption.redeemedAt, redemption.receipt and redemption.source as properties, with the same unique_id rule.
quiz.completedCreate an event, such as Portico Quiz Completed.quiz.score, quiz.maxScore and quiz.passed as properties, so a flow can treat a pass differently.
03

Consent, and how it maps

In Klaviyo, consent is a subscription with a time, separate from the profile. Portico sends one boolean, as it stands now, and the time of the event. In Portico a capture form records consent by purpose: participation and prize delivery are implied and their texts shown, marketing is a tick box that is never pre-ticked or required, and analytics follows the page's cookie banner. participant.marketingConsent is the marketing purpose's latest state; a form field you marked as marketing-only is left out of answers when it is false.

Portico fieldKlaviyo fieldRule
participant.marketingConsent (true)An email subscription to your list, consented at occurredAtSubscribe only on true.
participant.marketingConsent (false)No subscriptionCreate or update the profile if you want the record, but do not subscribe it.
participant.marketingConsent and participant.phoneSMS consentOnly if your Portico consent wording covers SMS and a phone number is present; otherwise email only.
participant.email, participant.phoneemail, phone_numberProfile identifiers. They are never in answers.
answers.<your CRM names>Profile properties of the same namesEach form field arrives under the name you gave it in the Portico console.
profile.marketingOptIn (opted_in, opted_out, not_asked)The same subscription, on campaigns with entry requirementsTreat not_asked as no change, not as a no.
04

Set up in Zapier

One Zap with a Catch Raw Hook trigger, a signature check and a path per event type. Zapier's hook URL is a public https address, which is what Portico requires.

  1. In Zapier, start a Zap with the trigger Webhooks by Zapier, Catch Raw Hook, and copy the hook URL.
  2. In the Portico console, open Integrations, Event webhooks, and add an endpoint with that URL. Tick lead.captured, reward.awarded, reward.redeemed and quiz.completed. Leave “Include prize codes and offer links” off unless Klaviyo should hold the code.
  3. Press “Test lead.captured”. Zapier receives the sample with every key filled, so the mapping you make from it works on every real event.
  4. Add a Code by Zapier step that checks x-portico-signature against your webhook secret (the snippet below) and parses the body, then a Paths step on type.
  5. lead.captured path: Klaviyo, Create or Update Profile, from participant and answers. Then a Filter on participant.marketingConsent is true, and Klaviyo, Subscribe Profile to List.
  6. reward.awarded, reward.redeemed and quiz.completed paths: Klaviyo, Create Event, with a metric name per type, the profile's email and the event's properties; put Portico's id in the unique id field.
  7. Turn the Zap on. In Portico's delivery log, each event should show sent with status 200; a failed delivery can be sent again from there with the same id.
05

Set up in Make

The same shape in Make: a custom webhook, a router and Klaviyo's modules or the HTTP module. Make's formula language has sha256 with a key, so the signature check is a filter rather than a code step.

  1. In Make, add a Webhooks, Custom webhook module and copy its address.
  2. Add the address as an endpoint in the Portico console (Integrations, Event webhooks), tick the four events and press a test so Make learns the structure.
  3. Add a Router. On every route, a filter compares the header's v1 with sha256(t + "." + body; hex; secret) and stops when they differ; a second condition routes on type.
  4. lead.captured: Klaviyo, Create or Update a Profile; then, when marketingConsent is true, Klaviyo, Subscribe a Profile to a List.
  5. reward.awarded, reward.redeemed, quiz.completed: Klaviyo, Create an Event, with Portico's id as the unique id.
  6. Run once, check the delivery log in Portico shows 200, then schedule the scenario to run on each webhook.
06

A worked lead.captured payload

This is the published sample, exactly as the console's Sample payloads and “Test lead.captured” send it: the envelope every event shares, then the lead's own keys. qualified and reasons appear only on a campaign that qualifies its leads (the B2B lead quiz), and profile only on a campaign with entry requirements; every other campaign leaves them out, so an existing mapping reads the same.

lead.captured, as the test send posts it
{
  "version": 1,
  "occurredAt": "2026-10-01T09:30:00.000Z",
  "campaign": {
    "id": "7b3f6a52-3f0e-4c8e-9a51-2f7d8c1e0a11",
    "slug": "spring-quiz"
  },
  "participant": {
    "id": "crm-123",
    "email": "[email protected]",
    "phone": "+46701234567",
    "marketingConsent": true
  },
  "session": {
    "ref": "0123456789abcdef"
  },
  "answers": {
    "company": "Example AB",
    "role": "Buyer",
    "newsletter": true
  },
  "id": "lead.captured:c1a2b3c4-d5e6-4f70-8a91-b2c3d4e5f607",
  "type": "lead.captured",
  "qualified": true,
  "reasons": [
    "Quiz: 4 of 5 (pass mark 3)",
    "Company size: 50–249 (at least 10–49)"
  ],
  "profile": {
    "version": 1,
    "name": "Alex Example",
    "company": "Example AB",
    "title": "Head of Marketing",
    "phone": "+46701234567",
    "telegram": "alex_example",
    "linkedinFollowClickedAt": "2026-10-01T09:28:00.000Z",
    "marketingOptIn": "opted_in"
  }
}
07

A worked reward.awarded payload

The same envelope with the reward block. code and deepLink are filled only for an endpoint that includes codes; otherwise both are null. delivery says how Portico delivered the reward (such as code or link). A gift card adds a giftCard block with its value and expiry.

reward.awarded, for an endpoint that includes codes
{
  "version": 1,
  "occurredAt": "2026-10-01T09:30:00.000Z",
  "campaign": {
    "id": "7b3f6a52-3f0e-4c8e-9a51-2f7d8c1e0a11",
    "slug": "spring-quiz"
  },
  "participant": {
    "id": "crm-123",
    "email": "[email protected]",
    "phone": "+46701234567",
    "marketingConsent": true
  },
  "session": {
    "ref": "0123456789abcdef"
  },
  "answers": {
    "company": "Example AB",
    "role": "Buyer",
    "newsletter": true
  },
  "id": "reward.awarded:5d2c9e1a-8b4f-4a37-b6c2-0e9f1a2b3c4d",
  "type": "reward.awarded",
  "reward": {
    "claimId": "5d2c9e1a-8b4f-4a37-b6c2-0e9f1a2b3c4d",
    "tierKey": "coffee",
    "label": "A free coffee",
    "delivery": "code",
    "code": "COFFEE-7Q2X",
    "deepLink": "https://example.com/redeem?code=COFFEE-7Q2X"
  }
}
08

Check the signature

Every delivery carries x-portico-signature: t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of t, a full stop and the raw body, keyed with the brand's webhook secret. Recompute it over the body exactly as received, before parsing, and compare in constant time. Dedupe on id: a retry of the delivery, a replay from the delivery log and a repeat of the same action all carry the same id. If you want replay protection, refuse a t more than a few minutes from your clock; Portico's own inbound signed calls allow five.

Node, as the console shows it
// Header: x-portico-signature: t=<unix seconds>,v1=<hex>
// Recompute over the raw body exactly as received.
const [t, v1] = header.split(",").map((p) => p.split("=")[1]);
const expected = crypto
  .createHmac("sha256", WEBHOOK_SECRET)
  .update(t + "." + rawBody)
  .digest("hex");
const genuine = crypto.timingSafeEqual(
  Buffer.from(v1, "hex"),
  Buffer.from(expected, "hex"),
);
09

Retries, and where it stops

A delivery that fails is tried again after one minute, then five, thirty, two hours and twelve: six attempts over about sixteen hours, after which it is marked dead and can be sent again by hand from the delivery log. Metric names are yours to choose and must be used consistently or a flow will not trigger. Klaviyo's subscription processing is asynchronous, so a profile may appear in the list a moment after the event. Portico never reads from Klaviyo: nothing comes back unless your systems send a business event or a redemption callback.

Klaviyo is a trademark of its owner; Portico Play is not affiliated with it. The Portico side of this recipe (events, keys, headers, signature, retries, consent) is taken from the product as it runs. The Klaviyo, Zapier and Make names are from their public documentation at the time of writing and may change; check them against your account.

Your brand. Your next big idea.

Let’s make it
worth playing.

Tell us about your audience and your next campaign. We’ll help you find the right game.

Talk to the studio