Visitor ID

Get the visitor ID assigned by Optimizely.

Syntax

visitor_id = window["optimizely"].get("visitor_id");
Parameters

Parameter and Type

Child Attribute

Description

visitor_id
string

The argument indicating to get visitor_id information. Required.

Return value

Parameter and Type

Child Attribute

Description

VisitorIdsObject

The visitor ID object contains the visitor ID assigned by Optimizely.

randomId
string

Child attribute of type VisitorIdsObject

A randomly generated user ID for the current visitor, which is used by Optimizely for calculating your results.

Example Call

visitor_id = window["optimizely"].get("visitor_id");

Example Return Value

{
  "randomId": "oeu1470101898133r0.04568111757824678"
}

Did this page help you?