Analytics

Attach attributes (for example the signed-in user's id, name and email) to a visitor.

Changed on

The top-level keys of custom_data are merged into what is already stored; a key set to null is removed. A deployed app can call this with its injected deployment token (permission visitors:enrich), using the sealed enc_… value of the _temps_visitor_id cookie, for visitors of its own project only.

put/analytics/visitors/{visitor_id}/enrich

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/analytics/visitors/{visitor_id}/enrich
  • Auth: HTTP bearer

Path parameters

visitor_idstring required

Visitor ID - can be numeric ID, GUID, or encrypted GUID (enc_xxx). Deployment tokens (visitors:enrich) may only use the encrypted GUID and only for visitors of their own project.

Request body

custom_dataobject required

Attributes to attach to the visitor. Top-level keys are merged into the visitor's stored custom_data; a key whose value is null removes that key. Deployment tokens may send at most 32 keys and 8 KB.

Response

Enrichment result. success: false means the visitor was not found (or is not in the caller's project) and nothing was changed.

messagestring required
successboolean required
visitor_idstring required

Changes

    • warning

      deleted the query request parameter project_id

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • breaking

      added the new required query request parameter project_id

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status