SamCart UTM Tracking Integration
Track campaign attribution through SamCart with HandL UTM Grabber, capturing UTM parameters, click IDs, referrer data, and landing pages on checkouts and sales.
Pass UTMs to SamCart Checkout with UTM Grabber
UTM attribution overview
SamCart captures URL parameters at checkout time. HandL UTM Grabber stores attribution in cookies. This guide shows how to connect the two using utm-out links, SamCart Tracking settings, and hidden custom fields prefilled from handl_utm.
What you need to know
SamCart stores UTM parameters present in the URL when an order is placed (SamCart UTM docs). Like ThriveCart, SamCart does not read cookies from your landing page. You need to get UTM Grabber data onto the checkout URL or into hidden fields.
Step 1: Configure SamCart Tracking & Pixels
In Marketplace Settings > Tracking & Pixels, map standard parameters:
- Source →
utm_source - Medium →
utm_medium - Campaign →
utm_campaign - Content →
utm_content
Add custom parameters (e.g. gclid, fbclid) via Add Parameter on the same tab.
Step 2: Append UTMs with utm-out
<a href="https://checkout.samcart.com/products/your-product/" class="utm-out">Buy Now</a>
UTM Grabber rewrites the href with all tracked cookie values. See utm-out class guide.
Step 3: Hidden custom fields for click IDs
- Create custom fields in SamCart (e.g.
gclid,fbclid) - Add them as hidden fields on your checkout page design
- Paste this in Products > Advanced > Embed HTML/Scripts in Footer:
<script>
setTimeout(function() {
if (typeof handl_utm === 'undefined') return;
Object.keys(handl_utm).forEach(function(key) {
var val = handl_utm[key];
if (!val) return;
jQuery('input[name="' + key + '"], input[id*="' + key + '"]').val(val);
jQuery('[data-field="' + key + '"]').val(val);
});
}, 1500);
</script>
For limitations and webhook method, see Webhook on success page.
Track UTMs in SamCart via Webhook on Success Page
UTM attribution overview
This walkthrough covers sending full UTM Grabber data from SamCart to Zapier, Make, or your own webhook. 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 guide.
When a 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 losing click IDs.
Thank-you page script
Paste this on your confirmation page. Swap in your Zapier or Make hook URL.
<script>
var 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 Zapier / Make checklist
- Create a Catch Hook trigger and copy the URL
- Run a test conversion with UTMs in the landing URL
- Confirm gclid, utm_source, and email (if present) show up in the payload
- Map fields into your CRM or spreadsheet
Parameter reference: Native WP Shortcodes.
Make users: see Make Integromat integration.