virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
blog / 2026-11-18

Paddle UTM tracking: pass UTM and custom data to checkout

By Devendra Variya, co-founder of Virling. Published 2026-11-18, updated 2026-11-27.

Paddle checkout does not pick up the UTM parameters on your page. To tie a Paddle transaction to the visit and channel that brought it, pass a visitor ID in the transaction's custom data: customData when you open checkout with Paddle.js, or custom_data when your server creates the transaction. Your analytics keeps the visits behind that ID, including their UTM tags, so each sale joins back to the channel. A visitor ID beats copying UTM tags, because it keeps every visit, not just one.

Where UTM tags get lost on Paddle checkout

UTM tags live in the landing page URL. Paddle only stores what you hand it, and Paddle's docs list capturing UTM or campaign information as a use for custom data you pass yourself (Paddle custom data docs). Here is where the tags drop off:

  • Overlay and inline checkout. Paddle.js opens checkout on your page, but the visitor is usually a few pages past the landing URL by then, and Paddle.Checkout.open sends nothing about the visit unless you set customData.
  • Hosted checkout. The link takes the buyer to a Paddle-hosted page. Its documented URL parameters include price_id, discount_code, user_email and transaction_id, but no custom_data or UTM parameters (Paddle hosted checkout docs).
  • Visits without tags. Search, referrals and AI answers carry no UTM at all, so UTM-only tracking marks those sales as untagged.
  • Buyers who come back later. Someone who lands from a newsletter and buys a week later from a bookmark has no tags on the visit that checks out.

Step 1: keep a visitor ID until checkout

Store one ID per visitor when they land, and record the UTM tags and referrer of every visit against it. With the Virling script, the ID is in the first-party virling_vid cookie, and window.virling?.vid?.() returns it in the browser. Put the script on the page that opens checkout as well as on your marketing pages. How Virling then picks the visit that gets the credit is in how attribution works.

Step 2: pass it as customData with Paddle.js

Paddle.js has two display modes. Overlay, the default, opens checkout in a layer over your page; inline renders it inside a <div> you choose. Both take the same customData option, which Paddle holds against the transaction the checkout creates (Paddle.Checkout.open reference). For overlay:

Paddle.Checkout.open({
  items: [{ priceId: "pri_...", quantity: 1 }],
  customData: { virling_vid: window.virling?.vid?.() },
});

For inline, add displayMode: "inline" and the class name of the target <div> as frameTarget under settings. Nothing about customData changes:

Paddle.Checkout.open({
  settings: { displayMode: "inline", frameTarget: "checkout-container" },
  items: [{ priceId: "pri_...", quantity: 1 }],
  customData: { virling_vid: window.virling?.vid?.() },
});

If you also want the tags readable in Paddle, add them next to the ID, for example utm_source and utm_campaign from the values you stored on landing. Virling only needs virling_vid. For the App Router, see Next.js Paddle UTM tracking. For a React app, see React Paddle UTM tracking, and for Django, Django Paddle UTM tracking.

Step 3: set custom_data on server-created transactions

When your backend creates the transaction, read the cookie from the request and set custom_data:

const res = await fetch("https://api.paddle.com/transactions", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.PADDLE_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    items: [{ price_id: "pri_...", quantity: 1 }],
    custom_data: { virling_vid: req.cookies.virling_vid },
  }),
});
const { data } = await res.json();
// Paddle.js: Paddle.Checkout.open({ transactionId: data.id })

This is also the way to keep the ID on a hosted checkout: create the transaction first, then send the buyer to your hosted checkout link with ?transaction_id= and the transaction's ID. Paddle notes that hosted checkout needs extra approval on live accounts.

customData, custom_data and Paddle's rules for them

The two names are the same field. Paddle.js uses camelCase customData, and the API uses snake_case custom_data on the transaction. If you open checkout with transactionId for a transaction your server already created, Paddle's reference says to use it instead of items and does not say what happens to a customData passed next to it, so set custom_data when you create the transaction.

  • Shape. Custom data must be valid JSON and contain at least one key, so an empty object is rejected (Paddle.Checkout.open reference).
  • Size and nesting. Paddle's custom data guide gives no size or key limit. It allows objects inside custom data but advises against nesting, so keep virling_vid as a top-level string (Paddle custom data docs).
  • Where it ends up. When a transaction creates a subscription, Paddle copies its custom data to the subscription. You can see it in transaction webhooks and when you get the transaction from the API.
  • Where Virling looks. Virling reads virling_vid from the transaction's custom_data only. The same key on a customer, product or price is ignored.

Step 4: renewals keep the first payment's channel

Paddle copies a transaction's custom data to the subscription it creates. Virling credits each renewal or plan change to the channel of the subscription's first payment, so recurring revenue stays with the channel that won the customer instead of landing in Direct. A one-off product has no renewals, so each completed transaction is one sale; Paddle attribution for templates, ebooks and fonts covers bundles, discount codes and free copies. Refunds and chargebacks lower the transaction's revenue once Paddle approves them.

Connect Paddle with a read-only API key and Virling does the join for you. The full setup is in the Paddle docs page and on the Paddle integration page.

Start free trial

Check that it works in the sandbox

  1. Connect a sandbox key that starts with pdl_sdbx_. Virling sends it to sandbox-api.paddle.com first.
  2. Set Paddle.js to the sandbox environment with Paddle.Environment.set("sandbox"), before Paddle.Initialize, and use a sandbox client-side token and price ID.
  3. Open a private window and visit a page that runs the script through a tagged link, such as https://yourdomain.com/?utm_source=test&utm_medium=email.
  4. In the same window, open the overlay or inline checkout from your page, with virling_vid in customData as in step 2, and pay with one of Paddle's test cards.
  5. Wait a minute for the next sync, then open the payments list at /app/yourdomain.com/payments. The payment shows the test source and the Email channel of your tagged visit instead of Unattributed.

Use a new email address for each test, because a later payment by the same customer is a renewal and keeps the first payment's channel. A site has one Paddle connection, and sandbox payments stay in your reports after you replace the key with a live one. If a step fails, see test your setup.

Common mistakes

What the report showsLikely causeFix
Overlay or inline payments are UnattributedCheckout was opened without customData. The script does not add the visitor ID to Paddle checkouts by itselfPass virling_vid in customData, as in step 2
Payments from server-created transactions are UnattributedThe transaction was created without virling_vid in custom_dataRead the cookie on the request that creates the transaction, as in step 3
Payments are Unattributed although Paddle holds the IDThe ID is in the custom data of a customer, product or price, which is not readSet it on the transaction
A payment lists a visitor ID but is UnattributedThat visitor's sessions all started before the lookback window, or after the paymentChoose a longer lookback window if your buyers take longer, and check that the script runs on every page where visitors arrive
A second test payment shows the first test's channelSame customer, so it counts as a renewalPay with a new email address
A refund does not lower revenue yetPaddle has not approved it, or the transaction has not been read again yetWait up to 6 hours after approval. A refund on a transaction older than 60 days is not picked up automatically
Payments from before you added the script are UnattributedThe first import reads the last 90 days, and those checkouts carried no visitor IDNothing to fix: they count as revenue, and new payments can be credited

Every other cause is in Unattributed revenue.

Why UTM tags in custom data are not attribution

UTM tags in custom data record one visit, the one that ended in checkout, and only if it was tagged. A visitor ID in custom data keeps one short value on the transaction while your analytics holds every visit behind it, so you can pick first touch or last touch later without changing checkout. The whole join, step by step, with a made-up channel table under step 5, is in how to track Paddle revenue by traffic source. For naming the tags themselves, see which UTM parameters to use.

Frequently asked questions

Does Paddle checkout record UTM parameters on its own?

Paddle's docs do not describe recording UTM tags or the referrer on a transaction. Paddle lists capturing UTM or campaign information as a use for custom data, which you pass yourself.

How do I pass custom data to Paddle checkout?

With Paddle.js, set customData when you call Paddle.Checkout.open. It must be a JSON object with at least one key. For transactions you create through the API, set custom_data on the transaction.

Can I add custom data or UTM tags to a Paddle hosted checkout URL?

Paddle's hosted checkout docs list no custom_data or utm parameters for the URL. Create the transaction on your server with custom_data, then pass its ID as transaction_id in the hosted checkout URL.

Should I put UTM tags or a visitor ID in custom data?

A visitor ID. UTM tags in custom data record one visit, and only when it was tagged. A visitor ID points back to every visit before the sale, tagged or not.

Is there a size limit on Paddle custom data?

Paddle's custom data guide gives no size or key limit. Custom data must be a valid JSON object with at least one key, and Paddle advises against nesting objects inside it.

Which channel do Paddle renewals get in Virling?

Renewals and plan changes keep the channel of the subscription's first payment, so they do not fall into Direct.

See which campaigns bring Paddle revenue

Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.

Start free trial See the demo