UTM Tracking in Thrive Cart and Send it to Zapier

You can track UTMs in Thrive Cart by adding the UTMSimple snippet on all of your pages:

First of all, let's add our UTMSimple tracking script:

Go to Custom Tracking Code section and add the script here Where is the tracking code?

Trigger Zapier when Checkout Initated:

Add the following code ONLY on checkout page Don't forget to replace the zapier Webhook with yours.

<script>

document.getElementsByName("customer.email")[0].addEventListener('change', function (evt) {

  var data = HandL.getAll()
  for (let i in [0]){
  	let form_elements = document.getElementsByClassName("pure-form pure-form-rows")[i].elements
  	for ( let el of form_elements ){
  		if ( el.name != '' ){
  			data[el.name] = el.value
  		}
  	}
  }
  
  data['ua'] = _thrive.user.ua
  data['cur_url'] = window.location.href
  
  var json = JSON.stringify(data);
  var xhr = new XMLHttpRequest();
  data = new URLSearchParams(data).toString()
  var xmlHttp = new XMLHttpRequest();
  xmlHttp.open( "GET", 'https://hooks.zapier.com/hooks/catch/11111111/xxxxxxx/?'+data, true );
  xmlHttp.send( null );
  });
</script>

You can do similarly for the main product purchase as well:


Revision #3
Created 14 March 2023 16:26:27 by UTMSimple
Updated 20 March 2023 23:41:20 by UTMSimple