Divi’s Email Optin module connects to Mailchimp, ActiveCampaign and many other email services, but not to Klaviyo. With Klaviyo for the Email Optin module on, Klaviyo appears in the module’s list of email providers. You add your account with a Klaviyo API key, pick a list, and Divi collects signups for it like for any other provider.
Before you start
In Klaviyo, create a private API key under Settings → API keys, with full access to Lists, Profiles and Subscriptions. Keep the key at hand; you paste it into Divi once.
Switch it on
- Go to Divi Doctor → Features.
- Under Email Optin module, find the Klaviyo for the Email Optin module card and click Enable.
The card’s checks show whether Divi 5’s Email Optin module was found, whether Divi lists Klaviyo with its own providers (Provider registered), and how many Klaviyo accounts are saved (Klaviyo accounts in Divi). If Provider registered says no, another plugin may have filtered Divi’s provider list.
Connect your Klaviyo account
- Open the page in the Visual Builder and open the Email Optin module’s settings.
- In Content → Email Account, set Service Provider to Klaviyo.
- Click Add. Type an Account Name of your choice, paste your key into Private API Key and click Submit.
- Divi saves the account and fetches its lists. Pick your list in the list menu, which starts on Select a list.
- Save the page, and clear any page cache.
Divi stores the account with its other email accounts, so every Email Optin module on the site can use it. If you add a list in Klaviyo later, click Fetch next to the list menu to load the lists again. Divi’s Remove button there removes the selected account.
If the key is wrong, Divi still adds the account, but no lists appear. The card’s Recent Klaviyo calls shows Klaviyo’s error, and the Klaviyo accounts panel shows No under Connected with check the API key.
Names and custom fields
Klaviyo has first and last name fields, so Divi’s name options in Content → Fields work as for other providers. The names go to the profile’s first name and last name.
To collect more, switch on Use Custom Fields in Content → Fields and add your fields. Klaviyo has no fixed list of fields to pick from: the Field ID you type for each field becomes the name of a property on the visitor’s Klaviyo profile. For example, a field with the ID company sets the profile property company.
- Ticked checkboxes are sent as one value, separated by commas.
- Empty fields aren’t sent.
- Up to 50 custom fields per form, with IDs of up to 100 characters.
Only the form’s own fields are sent
Divi passes on whatever custom fields arrive with a signup. So that nobody can add properties your form doesn’t have, Divi Doctor keeps a list of each Klaviyo form’s custom field IDs on the server and sends only those. A form is recorded when its page is viewed, and the record is updated when you change its fields. A signup is matched to its form, and its fields are sent only when the account and list are the ones the form was shown with. Up to 200 forms are kept.
If a page is served from a full-page cache built before you switched the feature on or changed the fields, the form isn’t recorded, and signups through it reach Klaviyo with the email and name only. Purge the cache once.
What happens when a visitor signs up
Divi runs the signup itself: its nonce check, spam protection, the email check and the list check all work as for Divi’s own providers. Divi then hands the signup to Klaviyo through Divi Doctor:
- For a new email, a Klaviyo profile is created with the visitor’s name and the form’s custom fields.
- The email is subscribed to the list with email marketing consent, with Divi Email Optin as the source.
- Existing profiles are never changed. If the email already has a Klaviyo profile, its name and properties stay as they are, and the email is only subscribed to the list. Otherwise anyone could rewrite another person’s details by signing up with their address.
- Klaviyo applies the list’s own opt-in setting, single or double. Set it in Klaviyo, on the list.
- If Klaviyo refuses the signup, the form shows Divi’s Subscription Error: followed by Klaviyo’s reason, and the call is logged.
The feature card
Klaviyo accounts
Lists each saved account in a table with the columns Account, Lists and Connected. Below the table is Remove Klaviyo accounts; see Remove saved accounts.
Recent Klaviyo calls
Keeps the last 30 calls to Klaviyo, newest first. Clear log empties it. The last call is also shown as Last Klaviyo call in the card’s checks.
| Column | What it shows |
|---|---|
| When | How long ago the call was made. |
| Call | Fetch lists, Subscribe, Create profile (listed only when creating the profile failed) or Remove accounts. |
| Result | OK or Failed, with Klaviyo’s HTTP status code. |
| Account | The Divi account name. |
| Contact | The subscriber’s address, shortened for privacy, for example ja***@example.com. |
| List ID | The Klaviyo list. |
| Details | For example 3 list(s) fetched., Subscribed., Subscribed. The email already had a Klaviyo profile, so its name and properties were left unchanged., or Klaviyo’s error text with the address hidden. |
API keys are never logged, and never shown in the builder.
Remove saved accounts
Klaviyo accounts and their API keys are saved in Divi’s email settings. To delete all of them:
- In Divi Doctor → Features, open the Klaviyo accounts panel on the Klaviyo for the Email Optin module card.
- Tick Remove all Klaviyo accounts and their API keys from Divi.
- Click Remove Klaviyo accounts.
Every Klaviyo account and key is deleted, together with Divi Doctor’s record of your Klaviyo forms. The log notes how many accounts were removed. Email Optin forms set to Klaviyo stop working until you add an account again.
- The button works while the feature is off too, so you can remove the keys after you stop using Klaviyo.
- Deleting Divi Doctor removes the Klaviyo accounts as well when Delete all Divi Doctor data when the plugin is deleted is ticked in Divi Doctor → Settings.
Check that it works
- Connect your account and pick a list as above, save the page and clear any page cache.
- Open the page in a private window, so you’re logged out, and sign up with a test address.
- In Klaviyo, open the test address’s profile. It has the name and custom fields from the form.
- Back on the card, Recent Klaviyo calls shows the Subscribe call as OK.
Limits
- Divi 5 Email Optin modules only.
- Only administrators who can use the Visual Builder can add, fetch or remove accounts there; Divi’s own checks decide.
- Turning the feature off removes Klaviyo from the Service Provider list. Forms still set to Klaviyo then show Divi’s Configuration Error: Invalid provider. Saved accounts stay in Divi’s email settings until you remove them.
- If a Divi update ever adds its own Klaviyo provider, Divi Doctor doesn’t add a second one. The card then shows Divi’s own Klaviyo as Found, and you can switch the feature off.
Note: After a Divi update, sign up once with a test address and check Recent Klaviyo calls. The feature plugs into Divi’s email provider system, so this is the quickest way to confirm it still works.
Questions
Can Divi’s Email Optin module connect to Klaviyo?
Yes, with Divi Doctor, a plugin for Divi 5. On its own, Divi’s Email Optin connects to Mailchimp, ActiveCampaign and many other services, but not to Klaviyo. With Klaviyo for the Email Optin module on in Divi Doctor → Features, Klaviyo appears in the module’s list of email providers. You add your account with a Klaviyo API key, pick a list, and Divi collects signups for it like for any other provider.
How do I connect Klaviyo to the Divi 5 Email Optin module?
In the module’s Content → Email Account, set Service Provider to Klaviyo and click Add. Type an Account Name, paste your key into Private API Key and click Submit, then pick a list. Create the key in Klaviyo first, under Settings → API keys, with full access to Lists, Profiles and Subscriptions. Every Email Optin module on the site can then use the account.
Can I send custom fields from a Divi Email Optin to Klaviyo?
Yes. Switch on Use Custom Fields in Content → Fields and add your fields. The Field ID you type for each field becomes the name of a property on the visitor’s Klaviyo profile, so a field with the ID company sets the property company. Up to 50 custom fields per form are supported, and empty fields aren’t sent.
Why are no Klaviyo lists showing in my Divi Email Optin?
Check the API key first. If the key is wrong, Divi still adds the account, but no lists appear. The feature card’s Recent Klaviyo calls shows Klaviyo’s error, and the Klaviyo accounts panel shows No under Connected. If you added a list in Klaviyo later, click Fetch next to the list menu to load the lists again.
Does the Divi Email Optin Klaviyo signup use single or double opt-in?
It uses the list’s own setting. Klaviyo applies the list’s opt-in setting, single or double, so set it in Klaviyo, on the list. The email is subscribed with email marketing consent, with Divi Email Optin as the source. If the email already has a Klaviyo profile, its name and properties stay as they are, and the email is only subscribed to the list.
How do I remove my Klaviyo API key from Divi?
In Divi Doctor → Features, open the Klaviyo accounts panel on the Klaviyo for the Email Optin module card. Tick Remove all Klaviyo accounts and their API keys from Divi. and click Remove Klaviyo accounts. Every Klaviyo account and key is deleted. The button works while the feature is off too, and Email Optin forms set to Klaviyo stop working until you add an account again.
To tag subscribers per form in Mailchimp, ActiveCampaign or AWeber, see Email Optin tags. To open the thank-you page in a new tab, see Open the redirect in a new tab.