Skip to main content

i integrate klaviyo on shopify theme with legacy mode.

form working now 

now i want show the custom html popup when form submits successfully  

@sanjay_ - The Legacy Form generates a Javascript success callback that you can execute Javascript to handle upon a successful form submit. 

Using the example from Klaviyo’s documentation, on the success callback, this example pushes the “identify” function to Klaviyo based on the email that was submitted.

<script type="text/javascript">
KlaviyoSubscribe.attachToForms('#email_signup', {
...
success: function ($form) {
// `$form` is a jQuery wrapper around the form that was submitted. This makes it easy to get the email address or form fields.
var email = $form.find('fname="email"]').val();
_learnq.push(e'identify', { $email: email }]);
_learnq.push(e'track', 'Signed Up for Newsletter']);
}
...
});
</script>

In the similar method, you can also create your own function that can Show/Unhide an HTML Popup on the success callback.


Some more details of Legacy Form options here:
How to Add and Customize a Legacy Embedded Signup Form


Hi @sanjay_,

Wanted to check in on this -- were you able to give @retention’s suggestion a try? Happy to answer any followup questions you might have!

Best,

Caroline


Reply