Anonymous Visitor ID

Visitor ID gives each browser that visits your website a random, anonymous identifier. Pertento attaches it to the events and experiment enrolments it records for…

3 min read


Visitor ID gives each browser that visits your website a random, anonymous identifier. Pertento attaches it to the events and experiment enrolments it records for that browser. You can also read it on your own pages, so you can link Pertento's data to your own records, such as orders.

Visitor ID is off by default and is turned on per website.

What you can use it for

  • Joining Pertento data to your own orders. Store the visitor ID alongside an order in your own system. You can then match that order to the experiment and variant the visitor saw.
  • Checking conversions against enrolments. Each conversion can be traced back to a specific enrolment in an experiment.

Turning it on

  1. 1Go to Websites and open the settings for your website.
  2. 2Switch on Visitor ID.
  3. 3Save.

It takes effect within about a minute. Browsers get an ID the next time they load a page on your website.

Visitor ID needs at least one running experiment on the website. A website that is only running surveys won't assign IDs.

What the ID is

Format

A random identifier (a UUID), for example 3f2b8c1e-9a4d-4e7b-b1c2-5d6e7f8a9b0c

Where it's stored

In the visitor's browser, in local storage, under the key PERTENTO_VISITOR_ID

How long it lasts

For the life of that browser's storage

What it contains

Nothing about the person: no name, email, IP address or fingerprint

Where Pertento sends it

Only to Pertento's own tracking. Pertento never sends it to your data layer, Google Analytics or any other third party.

Reading the ID on your pages

Once Pertento has loaded, the ID is available as:

const visitorId = window.Pertento?.visitorId;

The value is undefined in these cases:

  • Visitor ID is off for the website.
  • Pertento hasn't finished loading yet.
  • The browser blocks local storage, as some private browsing modes do.

Always check for a value before using it.

It identifies a browser, not a person

A visitor ID follows one browser on one device. Expect a new or missing ID in these cases:

  • The same person on a different device or browser gets a different ID.
  • Clearing site data, or using a private window, gives a new ID.
  • Safari removes website storage after 7 days without a visit, so a returning Safari visitor may get a new ID.
  • A checkout hosted on another domain, such as a Shopify checkout, can't see the ID from your storefront.

The ID itself contains no personal details. But it is a long-lasting identifier, and once you link it to your own customer records it becomes personal data on your side. Before turning it on:

  • make sure your cookie or consent banner covers it;
  • mention it in your privacy policy.

Turning it off

Switch off Visitor ID in the website's settings. Within about a minute:

  • browsers stop sending the ID to Pertento, and no new IDs are created;
  • Pertento stops storing IDs for that website.

IDs already stored in visitors' browsers are not deleted. They stay in local storage until the visitor clears their site data.