# 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](https://help.samcart.com/support/solutions/articles/60000506442-track-utm-parameters)). 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 &amp; Pixels

In **Marketplace Settings &gt; Tracking &amp; 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](https://docs.utmgrabber.com/books/102-getting-started-for-handl-utm-grabber-v3/page/appending-utms-to-the-buttons-using-class-name-attributes-selectively).

### 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 &gt; Advanced &gt; 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](https://docs.utmgrabber.com/books/samcart-integration/page/track-utms-in-samcart-via-webhook-on-success-page).