JavaScript widget for funnel
We provide a javascript widget to allow your application to start simply the widget session and receive some events.
Integration
Put the HTML code in the <body> part of your HTML page:
<script async src="https://widget.iswigo.com/agent.js"></script>
Usage
Initialization
window.iswigo('init', {});
The second parameter is options object.
Start funnel
To start user funnel, it's very simple. You need only the funnel session URL, and give this parameter like this:
window.iswigo('start', URL_OF_SESSION);
You can also close widget:
window.iswigo('close');
Events
Some events are available if you want catch user actions in the funnel with your website.
Usage
In options of widget initialization, example for widgetOpened event:
window.iswigo(
'init',
{
...,
onWidgetOpened: (event) => {
console.log('Widget opened!', event.detail);
},
...
}
);
You can also listen events on document object, example for connectionSyncAsked event:
document.addEventListener(
'iswigo.connection.sync.asked',
(event) => {
console.log('Connection synchronization asked', event.detail);
}
);
Event has detail stored in event.detail property.
Events list
All events have an object whose describe the event, with minimum the user_id property.
Detail is stored in event object and detail property.
Providers
-
providersDisplayed: provider list displayed
{ "user_id": "...", "parent_provider_id": "..." } -
providerSuggestionDisplayed: provider suggestion displayed
-
providerSuggestionDone: provider suggestion done
-
providerSuggestionError: provider suggestion error
Connection events
-
connectionSyncAsked: provider connection synchronization asked
{ "user_id": "...", "connection_id": "..." } -
connectionSyncDone: provider connection synchronization done
{ "user_id": "...", "connection_id": "...", "status": "..." } -
connectionCreationDisplayed: provider connection creation displayed
{ "user_id": "...", "provider_id": "..." } -
connectionCreationError: provider connection creation error
{ "user_id": "...", "provider_id": "..." } -
connectionCreationDone: provider connection creation done
{ "user_id": "...", "provider_id": "...", "connection_id": "..." } -
connectionEditionDisplayed: provider connection edition displayed
{ "user_id": "...", "connection_id": "..." } -
connectionEditionError: provider connection edition error
{ "user_id": "...", "connection_id": "..." } -
connectionEditionDone: provider connection edition done
{ "user_id": "...", "connection_id": "..." } -
connectionStepDisplayed: provider connection synchronization step displayed
{ "user_id": "...", "connection_id": "...", "step": "..." } -
connectionStepError: provider connection synchronization step error
{ "user_id": "...", "connection_id": "...", "step": "..." } -
connectionStepDone: provider connection synchronization step done
{ "user_id": "...", "connection_id": "...", "step": "..." }
Terms of service events
-
tosDisplayed: terms of service displayed
{ "user_id": "..." } -
tosAccepted: terms of service accepted
{ "user_id": "..." } -
tosError: terms of service validation error
{ "user_id": "..." }
Email validation events
-
emailDisplayed: email validation displayed
{ "user_id": "..." } -
emailDone: email validation sent
{ "user_id": "...", "email": "..." } -
emailError: email validation error
{ "user_id": "...", "email": "..." } -
emailTokenDisplayed: email token displayed
{ "user_id": "...", "email": "..." } -
emailTokenDone: email token done
{ "user_id": "...", "email": "..." } -
emailTokenError: email token error
{ "user_id": "...", "email": "..." }
Session events
- sessionError: funnel session error
- sessionExpired: funnel session expired
- sessionInvalid: funnel session invalid
Widget events
- widgetOpen: widget will open
- widgetOpened: widget opened
- widgetClose: widget will close
- widgetClosed: widget closed
- widgetResized: widget resized