Personyze Wiki Personyze Wiki docs
English
Open Personyze
Docs/ Developers/ Visitor IDs — keep every visitor’s ID exact in your code, files and integrations
Developers

Visitor IDs — keep every visitor’s ID exact in your code, files and integrations

A visitor ID can be up to 19 digits and negative: how the REST API, exported files, the page, Zapier, Make, n8n, Salesforce and the SDKs carry it, and how to keep it exact.

4 min read Updated 59 minutes ago

Every visitor Personyze sees gets a visitor ID: the number that names their profile, their visits and everything they did. You meet it as Visitor id on Data & privacy, as user_id in the REST API, as Visitor ID in the Zapier, Make and n8n apps, and as a column in the files you export. This page says what such an ID looks like, and what any code, spreadsheet or integration that carries one must do to keep it exact.

Keep a visitor ID as text. A visitor ID can be 19 digits long. A spreadsheet number, a JavaScript number or a number field in another tool keeps only about 15 digits, and silently turns a long ID into another visitor’s. Text, or a 64-bit integer, keeps it exact.

What a visitor ID looks like

  • A whole number of up to 19 digits, positive or negative: -1253418701 and 4611686018567254321 are both visitor IDs. A minus sign is normal.
  • Personyze gives new visitors 64-bit IDs, which are usually long. Visitors it already knew keep the IDs they had, of up to 10 digits, so an account holds IDs of both lengths side by side.

In the REST API

An answer writes a visitor ID — user_id, user_ids, and a product’s last_goal_user_id_0…_2 — as a JSON number while it fits in 32 bits (up to 10 digits), and as a string of digits past that. The same field can therefore be a number in one row and a string in the next.

Send the request header Personyze-Id-Format: string and every visitor ID comes back as a string. Write your client for that: read the ID as text, or as a 64-bit integer, and never through a floating-point number. On the way in, a visitor ID is read exactly whether you send it as a number or as a string. See REST API › Visitor ids.

In exported files

The CSV files the panel exports — Live visits’ Export CSV, a campaign’s audience, the lists on a campaign’s Performance step, an email campaign’s send log and QA step, the email consent export — write a visitor ID of 11 digits or more as a small formula, ="4611686018567254321". Excel and Google Sheets show it as the ID exactly, and save it again as the digits. An ID of 10 digits or fewer is written as plain digits, as before.

  • Personyze’s own imports read ="…" back as the ID, so an exported list uploaded again names the same visitors.
  • Feeding such a file to another tool, strip the =" and the closing " from that column first, or keep the column as text.

On the page

The tracking code exposes the current visitor as _S_T.uid. It is a number for an ID of up to 10 digits and a string for a longer one. Code of your own that reads it should compare it as text: String(_S_T.uid).

In integrations

  • Zapier — every step gives its Visitor ID as text. A Zap built on the earlier Add Visitor to Audience or Find Events step keeps a number field: replace that step with the current one. See Zapier.
  • Make and n8n — map visitor IDs only into text fields, and give every HTTP request the header Personyze-Id-Format: string. In the n8n node, Event › Get Many takes its Visitor ID in a number field. See Make and n8n.
  • Salesforce — map Personyze visitor ID to a Text field of at least 20 characters. A Number field is not written for a long ID. See Salesforce.
  • A form’s destinations (a webhook, Zapier, Klaviyo) send user_id as a JSON number while it fits in 32 bits and as a string past that. Make the receiving end accept both.

In the SDKs

  • Node.js — @personyze/node 2.0 carries visitor IDs exactly at any length, and keeps the browser tag’s visitor as one person. A 1.x library that hands its visits to the tag splits a 64-bit visitor into two. See Server-side personalization.
  • iOS — the SDK 2.1 carries visitor IDs exactly at any length.
  • Android — the SDK 2.1 gives each install an ID of up to 10 digits, on every account. Nothing to change.
  • PHP, Python and other servers calling the endpoint themselves — keep the ID as text, as in the REST API above.
Never go back to an older SDK. Taking a site from Node 2.0 back to 1.x, or an app from iOS 2.1 back to 2.0, turns every visitor with a long ID into a new visitor — a new history and a new A/B arm. The older versions read ten digits at most.
Get an AI plan for your site

Inspire me reads your website and suggests the personalization campaigns to run first, and who should see each one. Free.

Scan your site
Did this page answer your question?
Thank you — that goes to whoever maintains this page.