Keep UTM / URL parameters when user completes form & is redirected to Webflow thank you page URL

Scenario:

  1. User clicks on a Google Ad
  2. User now lands on a Webflow landing page, which automatically has the appropriate UTM parameters after the URL
  3. User fills out a form on said landing page
  4. I need the user to now be redirected to a thank you page (already built in Webflow), and that thank you page needs to keep the exact same UTM / URL parameters as before

How do I do this? I just spent an hour perusing the Webflow forums. Similar posts, but not exact. Thank you…

Here is my site Read-Only: https://preview.webflow.com/preview/science-care?utm_medium=preview_link&utm_source=designer&utm_content=science-care&preview=7d32db42453b52731700acecdf720d35&pageId=60380dab43df039a2514981f&mode=preview

Got a similar problem. Anybody can help?

I basically gave up on this. Based on my research, there is literally nothing you can do to customize the form redirect URL. You have to pick 1 address, and you can’t add anything dynamic, parameters, anything. So you’d have to use a third-party tool for your forms, as opposed to native Webflow forms. I think Webflow’s native forms are exceedingly simple and not marketing-friendly, and it’s a big turnoff.

you could try this script which worked for me.


<script>
const runScript = () => {
	const form = document.getElementById("YOURFORMID");
	const urlParams = new URLSearchParams(window.location.search);
	const utmParams = [
		"utm_source",
		"utm_medium",
		"utm_campaign",
		"utm_term",
		"utm_content",
	];

	if (form) {
		utmParams.forEach((param) => {
			if (urlParams.has(param)) {
				let field = form.elements[param];
				if (field) {
					field.value = urlParams.get(param);
				}
			}
		});

		form.onsubmit = (e) => {
			e.preventDefault();

			let params = Array.from(urlParams)
				.filter(([key]) => utmParams.includes(key))
				.map(([key, value]) => `${key}=${value}`)
				.join("&");

			form.action =
				"https://yourthankyoupage.com" +
				(params ? "?" + params : "");
			form.submit();
		};
	}
};

if (document.readyState === "loading") {
	document.addEventListener("DOMContentLoaded", runScript);
} else {
	runScript();
}
</script>```