UTM tracking and attribution in Wix Form
Create Hidden Fields in your WIX Form
Make sure the Field Title matches to our naming convention here What can I track with UTMSimple?
By default, these fields are not hidden, let's make them hidden
Go and Enable Dev mode
Select each field and go to Dev Mode and select "Hidden"
Add the following code in Wix > Settings > Custom Code section
<script>
handl_custom_params=[];var handl_js=document.createElement("script");handl_js.setAttribute("src","https://track.utmsimple.com/utm.js?license=<license key>"),document.head.appendChild(handl_js),handl_js.onload=function(){
handlj('body').on('DOMNodeInserted', '#main_MF', function(e) {
if (handlj(e.target).attr('id') === 'POPUPS_ROOT') {
setTimeout(
function(){
all = HandL.getAll()
Object.keys(all).forEach((x) => {
if (all[x]) {
if (handlj('[name="'+x+'"]').length > 0) {
const element = document.querySelector('input[name="'+x+'"]')
const event = new Event('input', { bubbles: true })
const previousValue = element.value
element.value = all[x]
element._valueTracker.setValue(previousValue)
element.dispatchEvent(event)
}
}
})
}, 2000)
}
});
};
</script>
Testing
Test the form and you will see all the UTMs listed in the Form Submission section