Carysadauskasdesigns Posted April 16, 2013 Share Posted April 16, 2013 Is there a way to automatically redirect my visitors to a different page in my site after they have filled out and submitted a form? I don’t want the page to go to the generic ‘Thank you’ message, but instead automatically go to a different page. Any thoughts? Brooklyn based freelance graphic designer, and SquareSpace enthusiast. Link to comment
pixel Posted April 16, 2013 Share Posted April 16, 2013 This is a sorely needed feature for squarespace. I can't wait till they add it. In the meantime if you are looking to track conversions in google anaylics this may be a workaround: http://answers.squarespace.com/questions/8612/can-anyone-think-of-a-way-of-triggering-a-google-analytics-pseudo-page-view Link to comment
colin.irwin Posted April 17, 2013 Share Posted April 17, 2013 I think you could adapt the code in the link above to fire off a page redirect once the form submission DIV is made visible. If you're looking for a Squarespace Developer, drop me a line. Link to comment
colin.irwin Posted April 17, 2013 Share Posted April 17, 2013 The following code seems to work. Replace “/” with the relative link you want the redirect to go to. If you want to link to an external site you’ll need to enter a full url of the format http://www.somewhere.com/somepage.htm The code should be inserted in the injection point for the form page: <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> var eventposted = 0; $(document).ready(function() { $('input.button').click(function() { window.setInterval(foo, 100); }); }); function foo() { if (($(".form-submission-text").is(':visible')) && (eventposted == 0)) { window.location.href = "/"; } } </script> If you're looking for a Squarespace Developer, drop me a line. Link to comment
Carysadauskasdesigns Posted April 17, 2013 Author Share Posted April 17, 2013 Thanks! I inserted it just as you said, and it works.... sort of. When I fill out the form, it still takes me immediately to the same thank you message, but it'll simultaneously try and slowly load the linked page (which is my blog page.) You can actually watch the little 'loading page' wheel on the website tab in the browser (I'm using Chrome) - it spins and skips a few times (it looks kind of glitchy) and then after about 15 seconds of that, it loads the page. I've tested it about 4 times and it's doing the same thing each time. All the rest of the pages are loading just fine, without hesitation. It's just this one redirect that is lagging. Any idea what may be causing this? Thanks again for your help! Brooklyn based freelance graphic designer, and SquareSpace enthusiast. Link to comment
colin.irwin Posted April 17, 2013 Share Posted April 17, 2013 You'd expect it to load the thank you message, because the redirect only happens once the DIV that holds the message becomes visible. When I tested it on my site there was a gap of a second or so before the redirect happens, I can't think of any reason that the code would be responsible for any delay. If you're looking for a Squarespace Developer, drop me a line. Link to comment
Carysadauskasdesigns Posted April 17, 2013 Author Share Posted April 17, 2013 Ok, well, I suppose I'll try it on a few different machines to see if it still does it. I've tried it several more times now, and there's still a very long delay after you submit, before the redirect page opens. hmmmm.... Brooklyn based freelance graphic designer, and SquareSpace enthusiast. Link to comment
colin.irwin Posted April 17, 2013 Share Posted April 17, 2013 Thinking laterally.. ..why not change the Thank you message to set the user's expectations: "Thanks for getting in touch.. ..you will be automatically redirected to my blog page in a few seconds. To get there quicker, click this link... " If you're looking for a Squarespace Developer, drop me a line. Link to comment
Carysadauskasdesigns Posted April 18, 2013 Author Share Posted April 18, 2013 Would you mind telling me where you found this script? I want to see if I can find the glitch that is making it lag so long. Thanks for the suggestion above though! Brooklyn based freelance graphic designer, and SquareSpace enthusiast. Link to comment
colin.irwin Posted April 19, 2013 Share Posted April 19, 2013 The bulk of it was posted on here. I adapted it to add a condition to prevent it firing off multiple events and to insert the redirect function to replace a function that posts to Google Analytics. If you're looking for a Squarespace Developer, drop me a line. Link to comment
Elana Posted July 10, 2013 Share Posted July 10, 2013 Has anyone figured out a better work-around for this? I tried the above script and same issue - long delay, although it does work. Any updated script or other suggested solution would be great! Thanks. Link to comment
Guest Posted September 10, 2013 Share Posted September 10, 2013 Here is a better fix for you, this works every time for me! Simply replace "YOUR URL HERE" with your URL. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> var eventposted=0; $(document).ready(function(){ $('input.button').click(function() { window.setInterval(foo, 100); }); }); function foo(){ if(($(".form-submission-text").is(':visible')) && (eventposted==0)){ eventposted = 1; window.location.href = "YOUR URL HERE"; } } </script> Link to comment
olee22 Posted November 22, 2013 Share Posted November 22, 2013 I didn't manage to make it work, either the srcipt, the links, my setup, something is not working, and I'm just tired of this. So developers, please make this feature part of the form submission features. Link to comment
FyireChilde Posted February 12, 2015 Share Posted February 12, 2015 I have tried this code and it is not working, is this snippet not comparable with a light box form? Or is it not compatible with a landing page?My form is set to light box on a landing page, thus my confusion. Link to comment
colin.irwin Posted February 12, 2015 Share Posted February 12, 2015 The code I posted was written before the light box form option existed. I'll have a look at making a script that works with both form types (and maybe add to cart) bit it's going to be sometime next week before I'll have time to work on it. I need it for a couple sites - one of mine and a client's site - so it will definitely get done sooner rather than later. If you're looking for a Squarespace Developer, drop me a line. Link to comment
adamspicar Posted March 21, 2015 Share Posted March 21, 2015 Yes, it does NOT work with either the Light box form or the Cover Page. Solution would be awesome, sir! Thank you! Link to comment
DMobley232 Posted June 14, 2015 Share Posted June 14, 2015 I have tried both scripts and both result in a blank page after the form submission. Link to comment
devonstank Posted May 23, 2016 Share Posted May 23, 2016 I have a solution for this post on my site with a simple how-to video, as well as easy-to-read written instructions. You can find it at devonstank.com/squarespace-form-redirect Devon Stank @ Devonstank.com (Squarespace Tips & Tricks) Link to comment
squareguru Posted July 2, 2016 Share Posted July 2, 2016 We've created a free plugin to do exactly this (no coding required, just copy and paste): http://www.squareguru.com/form-redirect It’s been tested on all major browsers and works on mobile as well. www.squareguru.com Link to comment
squareguru Posted July 2, 2016 Share Posted July 2, 2016 We've created a free plugin to do exactly this (no coding required, just copy and paste): http://www.squareguru.com/form-redirect It’s been tested on all major browsers and works on mobile as well. www.squareguru.com Link to comment
luckydx302 Posted July 2, 2016 Share Posted July 2, 2016 There are many options which can be done via form by them please check this Link to comment
Third Ocean Posted January 31, 2018 Share Posted January 31, 2018 @silvabokis has the right code. I discovered that if you are using your form in a lightbox within an index you need to apply his code in the code injection space in the main settings or inside the site.region file if you're in developer mode. This twist on his solution wouldn't work if you have various forms throughout the website that all need their own redirect page. I'm using this for conversion tracking and retargeted advertising, so I'm just redirecting every form submission to www.mybaseurl.com/# and inputting that as my "converted" url. Raise Capital Faster: Reaching More Investors with the Power of Technology Link to comment
DavidTerrell Posted October 4, 2018 Share Posted October 4, 2018 This worked right away. The video demonstration in addition to the step by step instructions on your site made this extremely easy to do. I attempted 3 other codes/plugins before I found yours that did not work. Link to comment
Kate Posted June 17, 2020 Share Posted June 17, 2020 You could also redirect to a piece of downloadable content hosted on your site using this addon https://www.squareaddons.com/shop-2/file-redirect If you are looking for a way to add Anchor Links, Gallery Blocks, or a Rotating Banner with Content Blocks overlaid in Squarespace 7.1, you can find all these plugins in our Squarespace add-on store here: www.Squareaddons.com -- Enjoy! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.