Browser SDK hooks
Hooks provide an integration point allowing listening for certain events that occur within the SDK.
Hook types
Type | Description | Hook detail properties |
---|---|---|
converge.sdk.init.start | Fires when the SDK is starting to initialise. | None |
converge.sdk.ready | Fires when the SDK is finished loading. | None |
converge.sdk.ready.instance | Fires when an instance in a multi-instance setup has finished loading. | scope - detail of the instance |
converge.activity.tracked | Fires when an activity is tracked. | activityName - name of the activityactivity - activity payload (nullable)props - common properties (nullable)metadata - additional metadata (nullable)scope - detail of the instance |
converge.identity.changed | Fires when the user identity has changed by either Seeka detecting a change in the profile or when issuing a new profile for a new website visitor. | profileChangeCounter - count of profile changesidentifiers - identity profile |
converge.privacy.state.changed | Fires when the privacy consent state changes | newState - the current privacy stateoldState - the old privacy state |
Usage
<script>
window.addEventListener("converge.identity.changed", function (ev) {
console.log("Identity has changed!", ev.detail.identifiers);
});
</script>