Can I pass UTM parameters through my form?

In Cognito Forms, you can prefill form fields from other forms or from other pre-defined content. Prefilling form fields makes it easy to track UTM parameters alongside user entries.

This example script will fill forms on your site with fields named “UTM Source”, “UTM Medium”, etc. with the appropriate UTM parameters from your site’s Url.

var urlParams = new URLSearchParams(;

var utm_params = {
  "UTMSource": urlParams.get('utm_source'),
  "UTMMedium": urlParams.get('utm_medium'),
  "UTMCampaign": urlParams.get('utm_campaign'),
  "UTMTerm": urlParams.get('utm_term'),
  "UTMContent": urlParams.get('utm_content'),


Learn more about prefilling forms.

If you need further assistance setting up your prefill code, please contact our support team.