How to redirect newsletter thank you page to external site?

How to redirect newsletter thank you page to external site?

northwester
Tourist
13 0 3

Hi guys, when my visitor subscribes to my newsletter I want them to be redirected to another site. I'm using the Debut theme. I can't get this to work. None of the working solutions for others have worked for me.

 

Please help,

 

Thanks

Replies 7 (7)

MarinaPetrovic
Shopify Partner
559 124 193

Hi @northwester , try this - just enter your url values.

<script>
if (window.location == "Thank you page url") {
   window.location.href = 'URL that you want your customers to be redirected'; 
}
</script>

 

 

If you find my answer helpful, please mark resolved or like. 

M.Petrovic | Shopify Developer
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

northwester
Tourist
13 0 3

Hi Marina, thanks for the reply. Can you please tell me where to put the code? Do I put it inside newsletter.liquid? If so, is there any particular place that I should paste it in that section? I tried pasting inside newsletter.liquid ( I wasn't sure where to put it though) but it makes my store require a password in order to view it.

 

Thanks

MarinaPetrovic
Shopify Partner
559 124 193

Hi @northwester , you can add it in your theme.liquid file, just above </head>. Don't forget to add your url's. 🙂 

M.Petrovic | Shopify Developer
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
northwester
Tourist
13 0 3

Can you please tell me how to find the url of my thank you page (part 1)? When I optin to my newsletter, it just goes "https://myshopifystore.com/?customer_posted=true." Is that my thank you page?

 

Thanks

MarinaPetrovic
Shopify Partner
559 124 193

Ooooh, you should make custom validation for that form and on success add piece of code to redirect it. Do you know how to do that? 

M.Petrovic | Shopify Developer
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
northwester
Tourist
13 0 3

No I don't know how to do that sorry. Can you please tell me? Thanks

Jferguson1
Explorer
80 3 6

did this solution work for you in the end?