Automatic sign up form redirection

Jferguson1
Explorer
80 3 6

Hi, 

 

I have been given a solution by shopify support and I'd like some help on how to insert the code. 

 

The code enables customers to be automatically redirected once they fill in their email within the email sign up form. 

 

Screenshot 2024-02-18 at 10.57.46.png

 Picture 1 shows the email sign up form. 

 

This is the message i got from shopify support:

  1. Edit the Form Code:
    • Go to your Shopify admin dashboard and navigate to Online Store > Themes > Actions > Edit Code.
    • Locate the form file where the email sign-up form is present (e.g., sections/[newsletter.liquid](http://newsletter.liquid) or sections/[footer.liquid](http://footer.liquid)).
    • Add the following code snippet just after the form submission code:
<script>
document.getElementById('yourFormId').addEventListener('submit', function() {
  [window.location.href](http://window.location.href) = 'URL_of_Your_Thank_You_Page';
});
</script>
  1. Customize the Code:

    • Replace 'yourFormId' with the actual ID of your email sign-up form.
    • Replace 'URL_of_Your_Thank_You_Page' with the URL of your custom thank you page.
  2. Save Changes and Test:

    • Save the changes to the theme files.
    • Test the form submission process to ensure that users are redirected to the thank you page successfully.

 

I just need some help on where to insert it and what changes i need to make.

 

https://tryy.co.uk/?_ab=0&_fd=0&_sc=1

password - help

 

many thanks

Replies 0 (0)