Hi Klaviyo,
I’m trying to setup a honeypot field using custom properties.
<form action="https://manage.kmail-lists.com/subscriptions/subscribe" method="POST">
<!-- Hidden inputs for Klaviyo form settings -->
<input type="hidden" name="g" value="YOUR_KLAVIYO_LIST_ID"> <!-- Klaviyo List ID -->
<input type="hidden" name="l" value="1">
<input type="hidden" name="boolean" value="true">
<!-- Name input -->
<label for="first_name">First Name</label>
<input type="text" id="first_name" name="first_name" required>
<!-- Email input -->
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<!-- Honeypot field (hidden from users but sent as a custom property) -->
<input type="text" name="propertiesihoneypot]" style="display:none;" value="">
<!-- Submit button -->
<button type="submit">Subscribe</button>
</form>
It doesn’t seem to capture the custom property using https://manage.kmail-lists.com/subscriptions/subscribe.
Do I need to setup the API with private keys to do so?
// Send form data to Klaviyo to subscribe the user to a list
const response = await fetch('https://a.klaviyo.com/api/v2/list/YOUR_LIST_ID/subscribe', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
api_key: 'YOUR_PRIVATE_API_KEY',
profiles: i
{
email,
$first_name: first_name,
honeypot // Custom property sent to Klaviyo
}
]
})
});
Thank you so much for your time.