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

Creem UTM tracking: which channel brought each payment

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

UTM values do not go on a Creem payment at all. Put a visitor ID there instead: when your server creates the Creem checkout, set virling_vid in its metadata, read from the virling_vid cookie. Creem sends that metadata back in the checkout.completed webhook, and Virling joins the payment to the visits that came before it. Open the payment in Virling to see its channel, page and campaign. Hosted Creem links do not get the ID by themselves, so the checkout has to be created by your server.

Why UTM tags do not reach Creem payments

UTM tags live on the URL your visitor landed on. They do not reach the payment, for two reasons:

  • The visitor is usually a few pages in by the time they click Buy, so the tags are no longer in the address bar.
  • Checkout runs on Creem, a different site from yours, so nothing on your page travels with the buyer unless you put it in the checkout.

You could copy the UTM tags into checkout metadata, but that alone loses the first visit. The tags you copy are the ones on the page at checkout time, if there are any. The search, post or referral that first brought the buyer a week earlier is gone, and so is every visit that carried no tags. A visitor ID points back to all of those visits, the first one included.

Step 1: add the Virling script

Put the script on every page that links to checkout. It sets a first-party virling_vid cookie and records the source of each visit against it: referrer, UTM tags or direct. Because the cookie is on your own domain, your server receives it with every request from the browser.

Step 2: create the checkout with the visitor ID in metadata

Creem checkouts are created by your server. Read the visitor's virling_vid cookie from the request and set it in metadata:

const res = await fetch("https://api.creem.io/v1/checkouts", {
  method: "POST",
  headers: { "x-api-key": process.env.CREEM_API_KEY, "content-type": "application/json" },
  body: JSON.stringify({
    product_id: "prod_...",
    success_url: "https://yourdomain.com/thanks",
    metadata: { virling_vid: req.cookies.virling_vid },
  }),
});
// Send the customer to (await res.json()).checkout_url

Use https://test-api.creem.io with a test mode key. Send your Buy button to a route on your server that runs this and redirects to checkout_url, rather than linking to a fixed Creem product link. The script does not add the visitor ID to Creem links on its own, so a payment made through a hosted link with no metadata shows as Unattributed. If you sell templates, ebooks or courses from shared Creem links, Creem analytics for digital products shows the small server route that replaces them.

Virling reads virling_vid from the checkout's metadata first, then the subscription's metadata, then the customer's metadata.

Step 3: connect Creem

In Creem, open Developers, then API keys, and create a key with the transactions:read scope, plus subscriptions:read so Retention can tell who still pays, and webhooks:write so Virling can add its webhook. No other scopes are needed. Paste it into Virling. Live and test mode keys both work.

Creem returns checkout metadata only in webhooks, not on transactions. So when you connect, Virling adds one webhook for checkout.completed and checks each delivery against the creem-signature header. You do not write a webhook handler. The webhook needs Virling to be on a public https address. The hosted version already is. If you self-host on plain http, payments still import but stay Unattributed.

Virling imports transactions from the last 90 days on the first run, then new ones every minute. The full setup is in the Creem docs and on the Creem integration page.

Step 4: check that it works

  1. Connect a key that starts with creem_test_. Virling must be on a public https address, so that Creem can reach the webhook.
  2. 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.
  3. In the same window, go to a test checkout your server creates with virling_vid in metadata, and pay with a test card.
  4. 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. Open it to see its visitor ID and the journey that starts at your tagged visit.

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 Creem connection, and test payments stay in your reports after you replace the key with a live one.

If the payment lists no visitor ID, the checkout did not carry virling_vid: check that your server reads the cookie on the request that creates the checkout, and that Virling is on a public https address so the webhook arrives. The full checklist is in test your setup.

Common mistakes

What you seeCauseFix
Every payment is UnattributedVirling was not on a public https address when you connected, so the webhook is missingOn your own server, set VIRLING_BASE_URL to a public https:// address, restart Virling, then use Replace key to add the webhook
Some payments are UnattributedThe checkout had no virling_vid in its metadata, as with a hosted Creem linkCreate the checkout on your server and read the virling_vid cookie there, as in step 2
Payments from before you connected are UnattributedNo webhook brought their visitor IDNothing to fix: they count as revenue, and new payments can be credited
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 show yetTransactions from the last 60 days are read again every 6 hoursWait up to 6 hours. A refund on an older transaction is not picked up automatically
Retention goes by how recently people paidThe key has no subscriptions:read scopeCreate a key with that scope and use Replace key
Virling's webhook is still in Creem after you disconnectDisconnecting does not remove itDelete the webhook, and the key, in Creem

Every other cause is in Unattributed revenue.

Example: three tagged posts

Example only: the product, its $20 a month plan and every number below are made up. The founder shares three posts in November, each with its own utm_campaign, named with the UTM naming template. The table counts first payments only, with no refunds, and leaves out Unattributed payments.

PostCampaign tagVisitorsSalesRevenueRevenue per visitor
LinkedIn posthow-it-works-2026-111,2009$180$0.15
X threadlaunch-thread-2026-113,0006$120$0.04
Indie Hackers postlessons-2026-114006$120$0.30

Repeat the LinkedIn post first: it brought the most sales and the most revenue. Repeat the Indie Hackers post too, since it made as many sales as the X thread from fewer than a seventh of the visitors. The X thread had the most visitors and earned the least from each, so change it before you post it again. These are small samples, so look at the next few posts before you drop a channel. In Virling, this is the Campaign tab of the Channels card, covered in revenue by campaign.

Start free trial

What you see after setup

Each payment is joined to the visits of the buyer who paid, so revenue groups by channel, referrer, landing page and campaign. Every payment after a customer's first is a renewal that keeps the channel of the first payment, so it is not counted as a new customer; attribution for Creem subscriptions covers trials, seat upgrades and renewals in a SaaS. Transactions from the last 60 days are read again every 6 hours, so refunds and chargebacks update the payment they belong to and a channel does not look better than it is. The steps behind the join are in how to track Creem revenue by traffic source, and for choosing which visit gets the credit, see first touch or last touch.

Frequently asked questions

Does Creem keep the UTM parameters from my site?

No. Checkout runs on Creem, a different site from yours, so the tags on your landing page do not travel with the buyer. Pass a visitor ID in the checkout's metadata instead.

How do I pass metadata to a Creem checkout?

Set metadata when your server creates the checkout with a POST to /v1/checkouts. Add virling_vid, read from the virling_vid cookie, and send the customer to the checkout_url in the response.

Do hosted Creem links get the visitor ID automatically?

No. The Virling script adds the visitor ID by itself only to some providers' checkout links, and Creem is not one of them. Create the checkout on your server with virling_vid in its metadata.

Should I put UTM tags in Creem checkout metadata?

Put a visitor ID there instead. UTM tags copied at checkout record only the visit the buyer is on when they pay, so the first visit is lost, along with every visit that had no tags, such as search and referrals. A visitor ID points back to all of them.

Why does Creem attribution need a webhook?

Creem returns checkout metadata only in webhooks, not on transactions. Virling adds one checkout.completed webhook when you connect, so it needs to be reachable over https.

What happens to payments with no visitor ID?

They have no visit to join, so Virling shows them as Unattributed. They still count toward revenue.

See which channels bring Creem payments

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