Set Redirect URL in JS embed and redirect to thanks page with parameters persisting

Hi, loving the platform.

I am looking for the parameters on the landing page where the form resides to persist on to the thank you page - a different page on the site.

For example landing page could be:
https://website.com/landingpage?hello=world
https://website.com/thanyoupage?hello=world

But I can only land people on:
https://website.com/thanyoupage

I was looking at the onFormComplete function and thought I could set something there with some manual JS which takes the params and appends them to the TY page url.

<script>
(() => {
	const url_params = window.location.search;
	const thanks_url = "https://the-url-of-the-thank-you-page";
	const thanks_pg = thanks_url + url_params;
	console.log('thanks_pg: ' + thanks_pg);

        Feathery.init('XXXX');
	Feathery.renderAt('container', { formName: "Sample Guide", onFormComplete: "window.location.href = thanks_pg", initialLoader: { show: true, loader: '<div class="loader"><img src="https://uploaded-images-1.s3.amazonaws.com/uploaded_images/113985/2024-04-04T08%3A38%3A43.189027%2B00%3A00/spinner.gif" height="75" width="75"/><p>Loading your future...</p></div>' } });
})();
</script>

Would love some support if this can be handled and if so, how.

Thanks
Ben

Hi @bfRhap . Thanks and really happy that you are liking the platform.

Regarding the query params, you should be able to do that. The onFormComplete expects a JS function. So, you can use a redirect logic and append any query params into the redirect URL.

An example code for this is available at onFormComplete() | Feathery Docs

Code for your quick reference:

onFormComplete={() => {
  window.location.href = 'https://google.com';
}}

Please let me know if this helps. Happy to share any other details that can help you get unblocked!

1 Like