Collecting UTMs in Leadpages
Insert the tracking script to your lead page
Edit the lead pages, click Settings > Analytics > Head Section Tracking Code
And paste your tracking code in there as shonw below.
Remember the change your license key accordingly!!!
<!-- Global site UTM Simple Tracking Start-->
<script>
handl_custom_params=[];var handl_js=document.createElement("script");handl_js.setAttribute("src","https://track.utmsimple.com/utm.js?license=<PUT YOUR LICENSE KEY HERE>"),document.head.appendChild(handl_js),handl_js.onload=function(){/*This is the UTM Simple ready event, you can put any code you'd like to trigger after the script fully loaded here*/};
</script>
<!-- Global site UTM Simple Tracking End-->
Zap the collected information
On your thank you page, place the following code to send all the collected data to Zap
Here we modified the code capture some parameters from the query arguments (WebinarJam), see handl_custom_params
section
Remember the change your license key and Zapier Webhook accordingly!!!
<!-- Global site UTM Simple Tracking Start-->
<script>
var handl_custom_params=['wj_lead_email', 'wj_lead_first_name','wj_lead_last_name','wj_lead_phone_country_code','wj_lead_phone_number','wj_lead_unique_link_live_room','wj_event_ts','wj_event_tz','wj_next_event_date','wj_next_event_time','wj_next_event_timezone']
var handl_js = document.createElement("script");
handl_js.setAttribute("src", "https://track.utmsimple.com/utm.js?license=<PUT YOUR LICENSE KEY HERE>"), document.head.appendChild(handl_js),
handl_js.onload = function() {
setTimeout(function(){
all_params = HandL.getAll()
Object.keys(all_params).map(function(x,y){console.log(all_params[x] = decodeURIComponent(all_params[x]))})
var data = handlj.param(all_params)
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", 'https://hooks.zapier.com/hooks/catch/4665641/76wc42/?'+data, false ); // false for synchronous request
xmlHttp.send( null );
}, 500);
};
</script>
<!--Global site UTM Simple Tracking End -->
All the parameters will be collected in the Zap