Triggering Zapier on Thank you Page

Simply add the following snippet on your thank you page.

The following script will merge the query argument with the handl utm grabber cookies and trigger your webhook with all the data.

This is especially useful, when prospects redirected from webinar optin signup where the optin data appended to the thank you page URL as query arguments.

Don't forget to change the Zapier URL below with your own Webhook URL.

var qvars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {qvars[key] = value;});
qvars = Object.assign(handl_utm,qvars)

	var data = new URLSearchParams(qvars).toString()
	var xmlHttp = new XMLHttpRequest(); "GET", ''+data, false ); // false for synchronous request
	xmlHttp.send( null );

}, 1000);

Revision #2
Created Tue, Mar 22, 2022 5:48 PM by Leman
Updated Wed, Mar 23, 2022 11:08 PM by Leman