PayPal Insights SDK - Set Command
DOCS
Last updated: Aug 15th, 8:05am
Use the set command to define parameters that will be associated with every subsequent event on the page.
1window.paypalInsight('set', EVENT_PARAMETERS);
EVENT_PARAMETERS
type:
objectrequired: true
payload:
Note: Depending on the events that you will trigger on the page, you can set any of those event's parameters globally.
Example
Note: The set command payload will set "global" attributes to be sent for each event on that page. The below example will end up combining the set payload and the event payload on each event.
1// This sets "session_id" and "user_data" globally2window.paypalInsight('set', {3 session_id: "session-12345",4 user_data: { country: "US", is_store_member: true }5});6function onCheckoutPageLoad() {7 window.paypalInsight('event', 'begin_checkout', {8 amount:{ currency_code: "USD", value: "9.99" }9 });10}11onCheckoutPageLoad()12 // Payload sent for begin_checkout event:13 // {14 // session_id: "session-12345",15 // user_data: { country: "US", is_store_member: true },16 // amount:{ currency_code: "USD", value: "9.99" }17 // }