Socialid.ruleEngine.createTrigger
From Social ID Developers
Contents |
Description
API to trigger a custom event for the user logged into the current login session.
See also:
Usage
socialid.ruleEngine.createTrigger(name, options, handler)
Parameters
name | required | the name of the custom event |
---|---|---|
options | optional | object with custom event options. |
handler | optional | callback function to handle the API response. |
API Response
status | The API response status. Can be success, if there is an user logged in the current login session and the event was successfully triggered, or not_found, if there is no user logged in the current login session. |
---|
Example
Triggers a custom "purchase" event:
socialid.login.init(1); var name = "purchase"; var options = { item: "shirt", promotion: "christmas" }; var handler = function(response) { if (response.status == "success") { alert("Event triggered successfully!"); } else { alert("Could not trigger event for the current logged in user."); } }; socialid.ruleEngine.createTrigger(name, options, handler);