Listening to Events
We strongly recommend using one of the Element SDKs to make listening to events easy. They provide you with callback functions that are invoked every time a specific type of event occurs (such asopen
, success
, exit
, etc).
Each type of Element will emit its own events. See General Events and Element Specific Events for more information about the events that are emitted.
PostMessage without SDK
To recieve events via PostMessage, pass the query parameterevent_channel=message
to the Elements url. For example:
Redirects
Redirects are the default way of listening to element events if you are not using one of the SDKs. Your webview / app should intercept the redirects in order to react accordingly to state changes. All redirect URLs will have the scheme (“prefix”)methodelements
. The event source will be the URL host and the payload will be query strings.
HTTP redirects from Method Elements are in the following format: