Events
The following table lists functions that the SDK calls immediately. Your analytics platform can use these events for tracking.Event | Description |
---|---|
onRender | Invoked after each message renders into the DOM |
onClick | Invoked after a user selects the message |
onApply | Invoked after a user selects the Apply button or link in the pop-up modal |
paypal.Messages
function to create a message object with optional properties for the onRender
, onClick
, and onApply
events. The functions in this example add an entry to the console log when one of these events occurs.
You also can use inline HTML attributes to add event hooks.
Note: The event handlers that you add to HTML override any attributes from the JavaScript API.
Logging
The following sample response shows an event message in the console log. For more information about logging events, see your analytics platform’s documentation about logging custom events. Add the necessary code to the function body of the event hook for themessages
configuration object.