Hey @Riz,
Our documentation team are working on revamping a number of those articles since the update to our Help Center.
In the interim, you can use the information below to redirect existing signup forms to Klaviyo.
To redirect your existing form signups to Klaviyo please see the steps below:
Redirecting a custom form to Klaviyo:
- Navigate to the Lists & Segments tab.
- Choose which list you want subscribers to be added to.
- In the menu bar, select Sign-up forms.
- Here, you'll see all of your sign-up forms that are tied to that list. Scroll past these to find the list's subscribe page.
- Hover over the page name and click Copy URL.
- Go to your custom form.
- Change the Form Action URL to the subscribe page URL you copied.
- Save your changes.
Generally speaking, the form should have the following properties:
<form id="email_signup" action="//manage.kmail-lists.com/subscriptions/subscribe" method="POST">
<input type="hidden" name="g" value="LIST_ID_HERE">
<input type="email" value="" name="email" id="k_id_email" placeholder="Your email" />
OTHER_FORM_CONTENT_HERE
<button type="submit">Subscribe</button>
</form>
<script type="text/javascript" src="//www.klaviyo.com/media/js/public/klaviyo_subscribe.js"></script>
Using a Klaviyo subscribe URL for a third-party sign-up form:
You can also add users to a list using a POST request from a third-party sign-up form. This method requires prior knowledge of using APIs. API requests are made to the Klaviyo Subscribe URL endpoint: https://manage.kmail-lists.com/ajax/subscriptions/subscribe
POST requests to the above endpoint add a user's email and additional user properties to any list in Klaviyo that you choose. This endpoint is unique from the standard subscribe endpoint used in Klaviyo's native sign-up forms.
The POST body requires you to pass 5 distinct properties:
- g (required) - The desired LIST_ID
- email (required) - The user's email address
- $fields (optional) - This tells the Klaviyo backend which keys (additional users properties) to expect in the POST request. All properties (other than email) need to be passed as a value under $fields and as its own key.
- $list_fields (optional) - This inherits from the data from $fields and transposes it as a custom property in list format
- other properties (optional) - For each property in $fields, you want to pass a key/value pair like below:
- $first_name: John
- $last_name: Smith
- Custom Property 1: Custom Value 1
- Custom Property 2: Custom Value 2
Since this would be considered a custom solution, if you need hands on assistance I would also encourage you to start working alongside your developer or reaching out to some of our expansive network of Klaviyo Partners.
David