Tracking UTMs in Paperform
First of all create your hidden fields in Paperform as shown below
There are various methods explained here https://paperform.co/help/articles/pre-filling-guide/
But we'll use the most effective one (Dynamic Auto Filling)
And then use the JavaScript below and copy paste the code where you want your form
<div data-paperform-id="kxjpum0m"></div>
<script>
document.addEventListener("DOMContentLoaded", function() {
const params = getAllHandLUTMParams();
const queryString = jQuery.param(getAllHandLUTMParams());
const form = document.querySelector("[data-paperform-id='kxjpum0m']");
if (form && queryString) {
form.setAttribute("prefill", queryString);
}
// Now embed the Paperform script
var script = document.createElement('script');
script.src = "https://paperform.co/__embed.min.js";
document.body.appendChild(script);
});
</script>
Make sure you change the form id based on your form. Note that there are two places.
All done, test it and you will see the parameters in the Result section of the form