Embed Snippet on Your Site
WWLC – Sync the Wholesale Lead Data to Klaviyo
Here's how to integrate your WooCommerce Wholesale Lead Capture registration form with Klaviyo so that new wholesale leads can check a box to subscribe to your email list during registration.
Step 1: Create the Opt-In Field in your Dashboard UI
Navigate directly to Wholesale → Settings → Wholesale Lead Capture → Registration Form → Custom Fields and add a new custom field:
• Field Name: Subscribe to our newsletter? (or your preferred consumer-facing text)
• Field Type: Checkbox
• Field ID / Meta Key: klaviyo_subscribe (Make sure this matches exactly, as your code snippet relies on it)
• Options Configuration: Since the plugin's checkbox field type generates a checkbox group, you will want to add exactly one option to the field:
◦ Value: 1
◦ Text: Yes (or your preferred consumer-facing text)
Once saved, the plugin takes care of displaying it on the registration form and securely saving the choice directly to the new user account profile data under that meta key.
Step 2: Sync the Lead Data to Klaviyo via Custom Code
Because the submission data and allowlisting are now fully handled by the plugin, we need a custom code to translate that saved user profile into a subscriber bulk job inside Klaviyo.
You will also need your Klaviyo List ID and Klaviyo Private API Key to securely authorize the API requests.
Then, you can place this custom PHP code snippet inside your child theme’s functions.php file or via a code snippets plugin such as WPCode Lite.
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments