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

  1. Create custom fields in SamCart (e.g. gclid, fbclid)
  2. Add them as hidden fields on your checkout page design
  3. 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.


Revision #1
Created 24 June 2026 14:12:34 by Leman
Updated 24 June 2026 14:12:34 by Leman