Skip to main content
Every short-link click adds a kid query parameter on the destination. A snippet on the client site stores that click in a first-party cookie and later credits a purchase or sign-up to the same click. Attribution is last-click: the most recent TrimYourl click in the visitor’s browser, if it is still inside the attribution window.

1. Paste the snippet

Open Settings → Conversions. Copy the snippet into the destination site’s <head>. In Google Tag Manager, add it as a Custom HTML tag that fires on all pages.
data-client is the workspace tracking key. data-days should match the attribution window you save in Settings (1–90 days). Paste the snippet again after you change the window so the cookie lifetime matches.
Browsers that limit cookies, such as Safari, often keep the click for about 7 days. A conversion after that cookie is gone cannot be credited.

2. Fire events

On the thank-you page or after a sign-up form:
Event names are yours. purchase and sale count as sales; other names count as leads. An orderId stops a reloaded thank-you page from counting twice.

3. Test

Open a short link, then trigger a conversion on the site. Add data-debug to the script tag, or run trimyourl("debug") in the console, to see each event. Credited rows show up under Settings → Conversions.

Webhook

Owners can set a conversion webhook URL in Settings. On each credited event TrimYourl POSTs JSON to that URL. See Conversion webhooks.

Server-side

If the snippet cannot run, POST /api/v1/convert with the same fields. See Track a conversion.