What You'll Learn in This Article:
- How to check whether a submitted email already exists in Klaviyo before the form submits
- How to show an error or send returning subscribers to a different page
- Which metadata keys to set, and where
- How to test the extension and fix common setup issues
The Klaviyo – Email Lookup extension checks whether a submitted email address already exists in Klaviyo. If it does, the campaign either shows an error message or sends the visitor to a different page, and the form is not submitted. If the email is new, the form submits normally.
The extension never blocks a visitor because of a technical problem. If the lookup fails, takes longer than 8 seconds, or can't run, the form submits normally.
To use the extension, you need a connected Klaviyo integration in your Digioh account.
Install the Extension
- Click your account name in the top right corner and select Extensions.
- Find Klaviyo – Email Lookup and click Install.
- Click Publish to Your Site to activate the extension. Installing takes effect on the next publish.
Connect the Extension to Klaviyo
The extension needs the ID of your Klaviyo connection.
- In the top navigation, click Integrations, then select Integrations. Find your Klaviyo connection (for example, Primary Klaviyo Connection) and note the ID shown on its card, such as ID 77513. You can click the copy icon next to the ID to copy it.
- Click your account name in the top right corner and select Account Metadata.
- Add the key
klaviyo_lookup_integration_idwith your Klaviyo connection ID as the value.
Please note: Use the ID of your Klaviyo connection, not the ID of a Klaviyo list or subscribe integration. If you use Digioh Passport for Klaviyo, this is the same ID as your tpau_proxy_integration_id account metadata.
Campaign Metadata Keys
In the campaign editor, go to Settings > Campaign Settings, turn on Campaign Metadata, and use the + button to add a row for each key you need.
| Key | Required | Value |
|---|---|---|
klaviyo_email_lookup_field |
Yes | The email field to check, such as email or ep2_email (see the field names below) |
klaviyo_email_lookup_error_message |
No | The error shown when the email already exists. If not set, the message is "Email is already registered!" |
klaviyo_profile_exists_change_page |
No | One page to send the visitor to instead of showing an error, such as ep1, ep2, thx, or main |
klaviyo_lookup_debug |
No | true to show detailed logs in the notification panel while you set up and test. Remove it when you're done. |
If both klaviyo_email_lookup_error_message and klaviyo_profile_exists_change_page are set, the change page is used and the error message is ignored.
Email Field Names
The value of klaviyo_email_lookup_field depends on which page the email field is on:
- Main Page:
email - Extra pages: the page name, an underscore, then
email, such asep1_emailorep2_email - Thank You Page:
thx_email
Important: If the field name doesn't match the page the email field is on, the extension can't read the email and every submission passes through without a lookup. For example, an email field on (EP2) will use ep2_email, not email.
Show the Error in Your Own Text Element (Optional)
By default, the error appears in the campaign's built-in error display. To show it in a text element you've placed in your design instead:
- Add a text element where you want the error to appear.
- In the element's settings, add element metadata with the key
klaviyo_email_error_positionand the valuetrue. - In the element's Extra CSS Styles (not Wrapper CSS), add
display: none;so the element is hidden until it's needed.
When an existing email is submitted, the extension puts the error message in this element and shows it. The element is hidden again at the start of the next attempt. If the element isn't a text element, or the value isn't true, the extension uses the built-in error display instead.
How It Works
- When the visitor leaves the email field, the extension starts the Klaviyo lookup early, so the answer is usually ready by the time they click submit.
- When the form is submitted, the extension holds it and shows a loading indicator until the lookup finishes.
- If the email exists in Klaviyo, the visitor sees the error message or is sent to your change page. The form is not submitted.
- If the email is new, the form submits normally.
The form also submits normally if the email field is empty, the lookup fails or takes longer than 8 seconds, or the connection ID isn't set. A submission is only blocked when Klaviyo confirms the email already exists.
If you also use Digioh Passport for Klaviyo on the campaign, the extension automatically waits to send the visitor's identity to Klaviyo until the lookup finishes. No setup is needed.
Common Setups
- Show an error on the same page: set
klaviyo_email_lookup_field=emailandklaviyo_email_lookup_error_message=This email is already registered. - Send returning subscribers to a different page: set
klaviyo_email_lookup_field=emailandklaviyo_profile_exists_change_page=ep1, then build your "You're already subscribed" message on (EP1). - Email collected on an extra page: set
klaviyo_email_lookup_field=ep2_email(use your page number). Everything else is the same.
Troubleshooting
Turn on klaviyo_lookup_debug = true and open the notification panel to see each step of the lookup.
| Problem | What to check |
|---|---|
| Every submission goes through, and the panel shows "No email value at submit - passing through" | klaviyo_email_lookup_field doesn't match the page the email field is on. For extra pages, include the page name, such as ep2_email. |
| The panel shows "klaviyo_lookup_integration_id not found" | Add klaviyo_lookup_integration_id in Account Metadata, using your Klaviyo connection ID. It must be account metadata, not campaign metadata. |
| The panel shows "klaviyo_email_lookup_field is not set" | Add klaviyo_email_lookup_field in the campaign's Campaign Metadata. |
| The change page doesn't work | Set klaviyo_profile_exists_change_page in Campaign Metadata, not Account Metadata, and use a single valid page name such as ep1 or thx. |
| The error doesn't appear in your text element | Check that the element is a text element, its klaviyo_email_error_position value is true, and display: none; is in its Extra CSS Styles, not Wrapper CSS. The notification panel shows a warning when it falls back to the built-in error. |
| Debug logs don't appear | Set klaviyo_lookup_debug in Campaign Metadata (not Account Metadata), with the value true. |
Running into an issue or have a question? Reach out to our support team at support@digioh.com.
Want to get more from Digioh?
Get the playbooks leading brands use to convert more visitors into revenue.
Browse the Playbooks