Skip to main content

Track UTMs in SamCart via Webhook on Success Page

UTM attribution overview

SendThis walkthrough covers sending full HandL UTM Grabber attributiondata from SamCart orders to Zapier, Make, or your CRMown usingwebhook. Handy when you need gclid, fbclid, first-touch fields, or custom params alongside the lead or order.

For the primary setup, see the main SamCart orderguide.

When webhooksa webhook makes sense

Native fields in SamCart often stop at basic UTMs. A webhook lets you push everything UTM Grabber stores without trimming values or alosing customclick success page script.IDs.

SamCart order webhook

Configure SamCart to POST order data (including custom fields prefilled from UTM Grabber) to a Zapier Catch Hook. Map utm_source, gclid, customer email, and order total to your CRM.

SuccessThank-you page script

Paste

Ifthis SamCart redirects toon your WordPressconfirmation thank-youpage. page,Swap usein theyour standardZapier mergeor Make hook URL.

<script>
fromvar qvars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
    qvars[key] = decodeURIComponent(value.replace(/\+/g, ' '));
});
qvars = Object.assign({}, (typeof handl_utm !== 'undefined' ? handl_utm : {}), qvars);
setTimeout(function() {
    var data = new URLSearchParams(qvars).toString();
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open('GET', 'https://hooks.zapier.com/hooks/catch/YOUR_ID/YOUR_KEY/?' + data, true);
    xmlHttp.send(null);
}, 1000);
</script>

Full pattern explained in Triggering Zapier on Thank you Page.

Quick toZapier combine/ Make checklist

  1. Create a Catch Hook trigger and copy the URL
  2. Run paramsa test conversion with handl_utm.

    UTMs

    Whyin usethe webhooks?

    landing
      URL
    • Confirm
    • Sendgclid, all click IDsutm_source, and customemail params,(if notpresent) justshow four standard UTMs
    • Push gclid to Google Ads offline conversions via Zapier
    • Tie revenue to campaignsup in HubSpot,the ActiveCampaign,payload
    • Map fields into your CRM or Salesforcespreadsheet

Parameter reference: Native WP Shortcodes.

Make users: see Make Integromat integration.