cubicast.identify(userId, [userTraits])
-
Arguments:
- {string} userId
- {Object} userTraits
-
Usage:
The Cubicast recorder will default identify your web app or site users as anonymous visitors. If your web app offers a sign-in mechanism, then by calling this function, you can identify the user of the recorded session.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// identifying a user by a unique ID cubicast.identify('12056'); // identifying users by email cubicast.identify('johndoe@example.com'); // providing additional user information cubicast.identify('12056', { name: 'John Doe' }); cubicast.identify('12056', { first_name: 'John', last_name: 'Doe' }); cubicast.identify('12056', { firstName: 'John', lastName: 'Doe', email: 'johndoe@example.com', nickname: 'jdoe', // this is typically the user name phone: '+18663423118' // use the new line character for multi-line addresses address: '71 Hudson Lane\\nWallingford, CT 06492', company: 'Big Apple' });
cubicast.track(eventName, [eventProperties])
-
Arguments:
- {string} eventName
- {Object} eventProperties
-
Usage:
Track custom events. The
eventName
argument is required and is case-insensitive. TheeventProperties
argument is optional, and when provided it should be a free-form dictionary containing the event properties. The maximum size of the event properties payload is set to 4KB.1 2 3 4 5 6 7 8 9 10
// tracking an event with no properties cubicast.track('User Signed Up'); // providing custom event properties cubicast.track('Plan Purchased', { plan: "PRO" });
cubicast.err(error)
-
Arguments:
- {Error} error
-
Usage:
Track caught JavaScript errors.
1 2 3 4 5 6 7 8
try { ... } catch (e) { cubicast.err(e); // your error handling code here ... }
cubicast.showSupportRequestDialog()
-
Usage:
Displays the dialog for users to submit a new support request when the widget is set to headless mode. This will throw an error if the workspace does not have a customer support integration added and it has the accept customer support requests switch enabled.
1 2 3 4
<button onclick="cubicast.showSupportRequestDialog()"> Feedback </button>