Cookies and consent
Analytics is cookieless unless you choose otherwise. An app can also keep a visitor id after the visitor accepts, so a returning visitor counts as the same visitor across days, with a consent banner LogSure shows or one of your own.
The modes
| Mode | What it does |
|---|---|
| Cookieless (the default) | No cookie and nothing stored on the device. Visitors are counted by a daily code that cannot be traced back; see Privacy. |
| Cookies, after Accept | Once the visitor accepts, the tracker keeps a random first-party id (logsure_id) and sends it with events. LogSure stores a keyed hash of it, never the id itself. Rejecting deletes it. |
Set it per app under Settings › Apps, the app, Cookies, or with set_consent_settings over MCP. Admins and the owner can change it; everyone can read it.
Who sees a banner
| Rule | |
|---|---|
| Off | No banner |
| Everyone | Every visitor is asked |
| EU and UK | Visitors from the EU, Iceland, Liechtenstein, Norway, the UK and Switzerland, from the country the proxy reports. A visitor whose country is not known is asked too. |
Each app follows the server's rule (Settings, off out of the box) unless it sets its own. Raise the banner's version to ask everyone again.
The built-in banner, or your own
- Built-in: your title and text, Accept and Reject, an optional Choose button and a link to your privacy policy, at the bottom or in a corner, light, dark or following the page.
- Your own: give CSS selectors for a container, an Accept and a Reject button, and optionally a settings link. The tracker shows the container when the visitor has to choose, wires the buttons, and hides it again; the settings link opens it later.
<div id="cookies" hidden>
We'd like to count returning visitors.
<button id="cookies-yes">Accept</button> <button id="cookies-no">Reject</button>
</div>
<a href="#" class="cookie-settings">Cookie settings</a>
With Google Consent Mode on, the choice is also passed to gtag as analytics_storage.
Before a choice
While the banner asks a visitor, events follow the app's setting (or the server's):
| Setting | What happens |
|---|---|
| Cookieless (the default) | Events go at once, without an id, so no page view waits or is lost. |
| Hold | Events wait for the choice, up to 1.5 seconds (5 at most), then go without an id. Leaving the page sends them. |
| None | Nothing goes until a choice. On a reject, or when the page is left, what waited is dropped. |
Where no banner shows, events go at once. For hold and none, the console's snippet carries data-before-choice, so the first page view follows the setting too: paste the snippet again after changing it. data-consent="false" on the tag skips the consent rules: no banner and no id.
From the page
logsure.consent.get(); // { analytics: true | false | null, version, decided, mode }
logsure.consent.set({ analytics: true }); // as if the visitor pressed Accept
logsure.consent.open(); // show the banner again
document.addEventListener('logsure:consent', (e) => e.detail.analytics && loadMyOtherScripts());
The choice is kept with the banner's version in the logsure_consent cookie. The id and the choice are kept for up to 13 months, or fewer days if the app sets it.
The fixed rules
These are not settings, because consent would not be valid without them:
- The id is written only after an explicit Accept, or
logsure.consent.set({ analytics: true }): never before an answer, on a timeout, by browsing on, or where no banner shows. - Reject is as easy and as visible as Accept.
- Nothing is pre-ticked.
- Withdrawing is always possible, with
logsure.consent.open()or the settings link, and a reject deletes the id.
The answers
Each answer is counted with its time, the banner's version, the choice and the country, without an address or an id. The app's settings show the accept rate, accepted and rejected over time, by version and by country; the same is in the API (getConsentStats) and over MCP (get_consent_stats). Consent belongs to the analytics feature: with analytics off for an app, the tracker stays cookieless and shows no banner.