Get the visitor ID assigned by Optimizely Web Experimentation.
Syntax
visitor_id = window["optimizely"].get("visitor_id");
Parameters
Parameter and Type | Child Attribute | Description |
---|---|---|
visitor_id string | N/A | The argument indicating to get visitor_id information. Required. |
Return value
Parameter and Type | Child Attribute | Description |
---|---|---|
VisitorIdsObject | N/A | The visitor ID object contains the visitor ID assigned by Optimizely Web Experimentation. |
randomId string | Child attribute of type VisitorIdsObject | A randomly generated user ID for the current visitor, which is used by Optimizely Web Experimentation for calculating your results. |
Example Call
visitor_id = window["optimizely"].get("visitor_id");
Example Return Value
{
"randomId": "oeu1470101898133r0.04568111757824678"
}