Skip to main content

Tracking UTMs in Paperform

First of allFirst, create your hidden fields in Paperform as shown belowbelow:

Hidden Fields Screenshot

There are various methods explained here https://paperform.co/help/articles/pre-filling-guide/.

But we'We'll use the most effective oneone: (Dynamic Auto Filling)Filling.

And thenNext, use the JavaScript below and copy copy-paste the code where you want your formform:

<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 idID basedin onboth places in the script according to your form. Note that there are two places.

AllOnce done, test it andto you will seeensure the parameters appear in the Resultresult section of the formform:

Result Section Screenshot