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

    Example

      1// This sets "session_id" and "user_data" globally
      2window.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 // }