Skip to main content

UTM Passing Script

When to use

If you have a dedicated sales page, you need to install the UTM passing script on the Hotmart checkout page.

Why it’s important

The UTM passing script plays a crucial role in transferring UTM information from one page to another within your sales funnel, ensuring this data is tracked until the checkout moment.

How to install

  1. Access the checkout page of your offer on Hotmart
  2. Add the script below in the <head> tag of the checkout page
  3. Save the changes
UTM Passing Script
<script>
   var timer = setInterval(function () {
      const location =
         window.trackingNemu?.nemuUtms ||
         new URL(document.location.href)?.searchParams;
      const fields = [
         "src",
         "sck",
         "utm_source",
         "utm_medium",
         "utm_campaign",
         "utm_content",
         "utm_term",
         "nemu_source",
         "nemu_medium",
         "nemu_campaign",
         "nemu_content",
         "nemu_adset",
         "nemu_term"
      ];
      var links = document.getElementsByTagName("a");

      for (var i = 0, n = links.length; i < n; i++) {
         if (links[i].href.includes("#")) continue;
         if (links[i].href) {
            let link = new URL(links[i].href);
            fields.forEach((field) => {
               if (location.get(field))
                  link.searchParams.set(field, location.get(field));
            });
            let href = link.href;
            links[i].href = href;
         }
      }
   }, 500);
</script>

Tracked Parameters

The script automatically captures the following UTM parameters:
  • src - Traffic source
  • sck - Custom tracking key
  • utm_source - Campaign source
  • utm_medium - Marketing medium
  • utm_campaign - Campaign name
  • utm_content - Specific content
  • utm_term - Search terms
Tip: The script runs automatically every 500ms, ensuring UTMs are captured even during quick page navigations.

Setting Up Webhooks

  1. In the left sidebar, click on Tools and then on View all
  1. In the search bar, type: Webhook and click on the displayed card
  1. Go to the Authentication tab and click on Copy to copy the Verification Hottok
  1. In Nemu, go to Settings > Webhooks, search for Hotmart and click on Connect
  1. Define a name for your Webhook, paste your Hottok copied in step 3 and click on Save
  1. Copy the Webhook URL generated.
  1. Go back to Hotmart and click on the + Register Webhook button
  1. Fill in the fields with the information from step 6 and click on Save
  1. In events, select All and click on Save