Help / Sales tracking on your own website
Sales tracking on your own website
Add a small script to your website to see which links bring sales and sign-ups.
If you sell through your own website, a small script can tell Linkliftr when someone who came through one of your links buys something or signs up. The sale is then counted for that link. Sales tracking is part of the Pro and Agency plans.
Selling through Stripe or Shopify? You can connect them directly instead. See Sales tracking.
How it works
- When a person clicks a tracked link, Linkliftr adds a random click reference to the address they land on, as ld_ref. For example yourshop.com/offer?ld_ref=.... Bots do not get one.
- The script on your website saves that reference in the visitor's browser, so it is still there if they browse around or come back later.
- When they buy or sign up, your thank-you page tells Linkliftr, and the sale is matched to the link they clicked.
The reference is random. It does not contain the visitor's name, email or anything else about them.
Step 1: switch on "Track conversions"
Open the link you want to measure, open "Routing, A/B split, pixels, apps and conversions" and tick "Track conversions". Only links with this ticked carry a reference. Do this for each link you want to measure.
Step 2: add the script to your website
Add this line to every page of your website, for example in the site header:
You can copy it from the Conversions page in Linkliftr.
Step 3: report the sale on your thank-you page
On the page people see after they pay or sign up, run:
The four values are, in order:
- Event name, for example purchase or signup. Use letters, numbers, dots, dashes and underscores. If you leave it out, it is recorded as conversion.
- Value, the order total, for example 49.99. Optional.
- Currency, a 3-letter code such as GBP. Optional.
- Order number. Optional, but we recommend it. It stops the same sale being counted twice, for example if the visitor reloads the page.
For a sign-up with no value, window.linkliftr.conversion('signup') is enough. If the visitor did not come through a tracked link, nothing is sent.
The funnel on the Conversions page uses signup for sign-ups and purchase for sales. An owner or admin can change these names there.
How long a click is remembered
- The script keeps the click reference for 90 days.
- A sale is only matched to a click from the last 90 days. If someone clicks your link and buys 4 months later, it is not counted.
- If the visitor clicks a tracked link again, the newer click replaces the older one.
Limits
- One click can have up to 20 conversions. After that, more are refused.
- The value of one conversion can be up to 1,000,000.
- The same event with the same order number for the same click is only counted once. Without an order number, the same event for the same click is also only counted once.
If your short links run on part of your own website
Some checkout pages cannot run your script, and some drop the ld_ref from the address. To help with this, Linkliftr can also leave the click reference in a cookie on your website.
This only happens when all of these are true:
- Your short links use your own domain, and it is a subdomain of your website. For example go.yourshop.com for yourshop.com. See Your own domain.
- yourshop.com is listed under "Your own websites" in Settings, in the UTM tracking section.
- The link has "Track conversions" ticked and goes to a secure (https) page on yourshop.com.
When someone clicks, Linkliftr leaves two cookies on yourshop.com for 2 hours:
- ld_click, the same random click reference.
- ld_to, the path of the page the link led to, for example /offer.
Your script reads ld_click on the next page where it runs, so the sale still finds its click. As your script only loads after consent, the cookie is only read after the visitor accepts.
If the visitor declines cookies, delete both cookies from your website. For example, your cookie banner can run:
document.cookie = 'ld_to=; Domain=yourshop.com; Path=/; Max-Age=0';
Replace yourshop.com with your own website's domain.
Seeing your sales
- Statistics shows a Sales section with revenue, conversions and conversion rate once your first sale or sign-up comes in.
- Each tracked link's page shows its own sales and funnel.
- The Conversions page shows all conversions, your top links, a breakdown by event and a funnel from clicks to sign-ups to sales.
What we keep
For each conversion we keep the event name, the value, the currency, the order number and the click reference. We never see card details.