Integrating Klaviyo Tool With Alhena AI
Automatically capture lead details from AI chat conversations and create/update Klaviyo Profiles, with consent handled when the user indicates it in the conversation.
The Klaviyo lead generation tool automatically extracts lead information from your user's conversations with your AI agent and adds them to Klaviyo. You can configure any values you'd like to extract and have them added to profile information inside of Klaviyo.
Setup
Connect Klaviyo
Go to Settings → AI → Connect tools → Klaviyo lead generation tool settings.
Paste your Klaviyo Private API key and click “Connect”. (Find your API key: Guide)
Choose attributes to extract
In “Add attributes for Klaviyo lead generation”, click “Add attribute”.
Provide:
Attribute name: the Klaviyo property key (e.g.,
email
,first_name
,phone_number
).Attribute description: how the AI should find this value in the conversation.
(Optional) Examples: sample values that guide extraction.
Save. Repeat for all attributes you want.
Notes:
We preconfigure the defaults and you’ll see them listed:
email
,first_name
,last_name
, andconsent
.Attribute names must match the property keys you want to populate in Klaviyo.

What’s captured
Defaults (always included)
email
,first_name
,last_name
consent
(see “How consent works”)
Automatic context (no setup needed)
alhena_chat_id
page_url
page_title
Visitor location details (city, region, country, latitude, longitude, zip, timezone, ip)
Optional attributes (you add these)
Any standard Klaviyo fields (e.g.,
phone_number
,external_id
,organization
,title
, etc)Any custom fields you want stored on the Profile
UTM attribution: add
utm_source
,utm_medium
,utm_campaign
,gclid
and we’ll parse them from the last page URL when present
For supported standard fields, see Klaviyo’s API: Create or Update Profile.
How consent works
You do not need to add a “consent” attribute—it’s included by default.
If the user indicates they give marketing consent in the conversation:
We record that consent in Klaviyo.
If
email
is present, we subscribe them to Email Marketing.If
phone_number
is present, we subscribe them to SMS (and transactional).
If the user does not give consent, we do not subscribe them.
Notes:
SMS subscriptions require Klaviyo SMS to be enabled. You can add a
phone_number
attribute from the Klaviyo lead generation setup, and if the user indicates they consent to marketing, they will be subscribed if they've also provided a phone number.
High-level flow
AI extracts your configured attributes from the chat (plus we add automatic context).
We call Klaviyo’s Profile Import to create/update the Profile.
If
consent
is true, we submit a subscription job for Email and/or SMS.
Last updated