Popin provides JavaScript events via the global function window.popinEvent
. These events allow you to track user interactions, permissions, and call activities on the Popin widget.
You can listen to these events and forward them to your analytics, backend systems, or third-party tools as required.
Place the following script below the Popin integration snippet:
window.popinEvent = (event, data) => {
if (event === "popin_captured") {
// Example: Facebook Pixel integration
fbq("trackCustom", "popinCapture", {
name: data.name,
mobile: data.mobile,
});
}
};
In this example:
event
represents the triggered event name (e.g., popin_captured
).
data
is the payload object associated with that event.
nudge_show
Description: Triggered when a nudge popup is displayed to the user.
Payload:
{
"uid": "string"
}
nudge_open
Description: Triggered when the user opens the nudge popup.
Payload:
{
"uid": "string"
}
nudge_close
Description: Triggered when the user closes the nudge popup.
Payload:
{
"uid": "string"
}
popin_permission_given
Description: Triggered when the user grants microphone and/or camera permissions.
Payload:
{
"uid": "string",
"audio": true,
"video": true
}
popin_permission_denied
Description: Triggered when the user denies microphone and/or camera permissions.
Payload:
{
"uid": "string",
"audio": true,
"video": true
}
popin_expert_busy
Description: Triggered when the expert is busy and cannot take the call.
Payload:
{
"uid": "string"
}
popin_rating_done
Description: Triggered when the user submits a rating and optional feedback after a call.
Payload:
{
"uid": "string",
"rating": "integer",
"comment": "string"
}
popin_schedule_created
Description: Triggered when the user schedules a call.
Payload:
{
"uid": "string",
"timezone": "string",
"time": "string"
}
popin_call_end
Description: Triggered when a call ends.
Payload:
{
"uid": "string",
"callId": "string",
"invited": true
}
popin_captured
Description: Triggered when a new user/lead is captured via the widget.
Empty or null fields are automatically removed.
Payload:
{
"name": "string",
"email": "string",
"country": "string",
"mobile": "string",
"city": "string",
"pin_code": "string",
"group": "string",
"uid": "string"
}
Every event includes a uid
field, which uniquely identifies the user session.
Payloads may vary based on:
User-provided input
Device permissions (microphone/camera)
Widget configuration
Optional fields may be omitted if not provided. Always handle missing fields gracefully.