Skip to content

Recognize returning visitors

By default Lyli stores nothing in your visitors’ browsers, so someone who comes back on another day counts as a new visitor that day. A site can instead recognize returning visitors: the script keeps a random ID in the browser of each visitor who agrees, and their visits link up across days. This article is for the admins who set up a site and whoever adds its script.

Cookieless by default

A new site is Cookieless. To tell visits apart within a day, we turn the IP address and the browser identification into a code, mixed with a random value that changes every day (UTC). Each day’s value is deleted within 2 days, so the codes can’t be followed from one day to the next.

So a person who visits on three days of a month counts as a visitor on each of those days, and three times in the month’s total. Their visits on one day share a code, as long as their IP address and browser stay the same.

What recognizing adds

For visitors who are recognized, these reports see the same person across days:

ReportWith recognized visitors
VisitorsSomeone recognized on three days counts once in the period’s total, and once on each of those days in the chart.
RetentionCounts only recognized visitors. Its Recognized tile shows what share of the period’s visitors that is; the rest got a daily code and are left out, not counted as gone.
CohortsOnly recognized visitors can be in one.
AttributionFirst visit credits a conversion to the visitor’s first visit in the period, which can be on an earlier day. With a daily code, a first visit is their first that day.
The visit panelIn Sessions and Realtime: which of their visits this is, how many they’ve made since when, and the goals they completed and revenue they sent, across days rather than that day only. It shows only where Individual visits is on.

Turn it on

1

Choose it in the site’s settings. Open the site’s Settings › General, then Tracking. Under Visitors, choose Recognize returning visitors and select Save changes. Only admins can change it. You can also choose it under Visitor identity when you add a site.

2

Add data-remember to the script tag only for visitors who agreed (below). The tag on Settings › Install always leaves it out.

3

Check it in Retention. Until a visitor comes with data-remember, it says “No recognized visitors yet.” After that, its Recognized tile shows the share.

For visitors who agreed
<script defer src="https://app.lyli.io/t.js" data-site="s_k3m9x2p7qa" data-remember></script>

s_k3m9x2p7qa stands for your site’s ID. With Via your domain, add data-remember to that tag the same way.

What’s stored

WhereWhat
In the browserA random ID in local storage under the key _aid, not a cookie. It has no expiry: it stays until the visitor clears their browser’s storage or your site removes it. Some browsers clear it on their own; Safari, for example, after 7 days of use in which the visitor doesn’t interact with your site. The script sends it with each page view, event, and page-speed report.
In our databaseOnly a hash of the ID, made with your site’s ID, never the ID itself. It’s a pseudonymous code, and our data processing agreement covers it as personal data.
IP addressesNever in our database. Our hosting provider’s request logs keep them for about 7 days.

Limits and edge cases

  • One ID per browser and hostname. Local storage belongs to one hostname, so a visitor on harbor.example and docs.harbor.example gets an ID on each and counts as two visitors. Another device or browser, a private window, or cleared storage means a new ID.
  • A browser that won’t store it sends no ID, and the visitor gets a daily ID.
  • data-remember on a Cookieless site still makes the script store the ID in the browser, but we ignore it. Add the attribute only once the setting is on.
  • Earlier visits aren’t linked. Visits from before you turned it on, or before a visitor agreed, keep their daily codes. When a period starts before that, Retention says from which day it recognizes visitors.
  • Switching back to Cookieless makes us ignore the ID from then on. Remove data-remember from your tag too, or the script keeps storing it.
  • Individual visits is a separate switch, off by default for every site. Recognizing returning visitors doesn’t turn it on.