redirect to a page after email sign up.

redirect to a page after email sign up.

3D-Cast
Excursionist
29 1 4

Hi 

I'm would like to know how to get the newsletter subscribe form to direct to a page after a successful submission instead of the little message it puts next to the box. Please tell me the code to insert so i can tell it to go to a certain url on successful submission? Also i would like to be able to add a first name option and a submit button instead of the arrow. I'm using the dawn theme. My page is here https://3dcaststore.com.au/ 

Thanks 

Reply 1 (1)

wildlangosta
Shopify Partner
51 8 10

Hey @3D-Cast ,

 

You will need some JS code similiar to this: 

<script>
document.getElementById("newsletter-form").addEventListener("submit", function(event) {
    setTimeout(function() {
        window.location.href = "https://yourredirecturl.com"; // Change this to your URL
    }, 500); // Small delay to allow form submission
});
</script>

 Please note a few things, Adjust the ID to your form ID. In addition, this is not really recommended for a good user experience if a user signs up for the mailing list and unexpectedly gets redirected. Is there something specific you wanted them to do or get redirected to? A better approach might be to have this form embedded on your store as a sign up form and make it clear that they will be redirected. If you have additional questions or get stuck, you are welcome to send me a DM.

 

 

Don't forget to mark as solution if this helped.
Want a faster website? Check out Shopify Speed Secrets - FREE.
Looking for a Full-service Shopify Agency to Skyrocket your Business Growth?? Visit our website.