Skip to main content

 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.

Hi @Jesus

I found a support ticket on this as well - sharing here as well:

You will need to create a form outside of Klaviyo. When hidden fields are submitted, bots cannot interact with or input data into them. These fields usually serve as extra tags for segmentation.
For more details, please refer to the article "Subscribe a profile via API." You'll need to create a custom sign-up form outside of Klaviyo, implement the honeypot, and then establish a custom connection to send the sign-up data to Klaviyo.
 
For instructions on how to create a honeypot field, we recommend reading the following resource: How to create a simple Honeypot protect your Forms against Spammers.
 
~Chloe


Reply