PayPal Insights SDK - Troubleshooting

DOCS

Last updated: Aug 15th, 8:01am

Debug Mode

Refer to the config command docs to enable debug mode.

Examples

Successful event

Debug mode will tell you when an event has been successfully registered. Here's an example:

    1window.paypalInsight("config", "YOUR_CLIENT_ID", { debug: true });
    2
    3
    4window.paypalInsight("event", "begin_checkout", {
    5 page_type: "checkout",
    6 session_id: "123456789",
    7 amount: { currency_code: "USD", value: "1.00" },
    8 user_data: { country: "US", is_store_member: false },
    9 experiment: [{ exp_name: "Fastlane conversion", treatment_name: "control", ramp: "50%" }]
    10});
    11/*
    12This message will appear in the browser developer tools console:
    13
    14
    15> [PayPal Insights] event "begin_checkout" - successfully registered
    16 The event name "begin_checkout" is a valid name
    17 The following event parameters are valid and are sent:
    18 > Object
    19 amount: Object { currency_code: "USD", value: "1.00" }
    20 experiment: Array [ { exp_name: "Fastlane conversion", treatment_name: "control", ramp: "50%" } ]
    21 page_type: "checkout"
    22 session_id: "123456789"
    23 user_data: Object { country: "US", is_store_member: false }
    24*/

    Failed event

    Debug mode will tell you when an event is invalid and failed to register. It will tell you about missing attributes that are required and about invalid data types. Here's an example:

      1window.paypalInsight("config", "YOUR_CLIENT_ID", { debug: true });
      2
      3
      4window.paypalInsight("event", "begin_checkout", {
      5 page_type: "checkout",
      6 amount: { currency_code: "USD", value: "1.00" },
      7 // missing the "session_id" required attribute
      8 // missing the "user_data" required attribute
      9});
      10/*
      11This message will appear in the browser developer tools console:
      12
      13
      14> [PayPal Insights] event "begin_checkout" - failed to register
      15 The event name "begin_checkout" is a valid name
      16 Error at: session_id. Message: 'session_id' is required.
      17 Error at: user_data. Message: 'user_data' object is required.
      18*/