Boxever.browserCreate(object, callback, format)
The browserCreate() function creates a browser ID and a guest reference.
Important
The Boxever JavaScript Library calls this function automatically when no browser ID is found in the cookies or in local storage. We recommend that you do not call this function. To create a browser ID or guest reference manually, use the [reset()](bx-reset.html "Boxever.reset()") function instead.
Parameters
| Parameter | Type | Description | Note |
|---|---|---|---|
object | object | An empty object. | N/A |
callback | function | This callback function handles the response. | The browser ID is in the ref key of the parameter that is passed to the callback function.The guest reference is in the customer_ref key of the parameter that is passed to the callback function. |
format | string | The format of the response. | Set the value to "json". Other formats are not supported. |
Return value
undefined
Example
Call the browserCreate() function. In the callback function, log the response to the console:
The following is logged to the console:
The ref key contains the browser ID. The customer_ref key contains the guest reference.
If you have suggestions for improving this article, let us know!