PayPal Insights SDK - Troubleshooting
DOCS
Last updated: Aug 15th, 8:01am
Debug Mode
Note: This should only be used during development to ensure that you are sending the right events.
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 });234window.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:131415> [PayPal Insights] event "begin_checkout" - successfully registered16 The event name "begin_checkout" is a valid name17 The following event parameters are valid and are sent:18 > Object19 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 });234window.paypalInsight("event", "begin_checkout", {5 page_type: "checkout",6 amount: { currency_code: "USD", value: "1.00" },7 // missing the "session_id" required attribute8 // missing the "user_data" required attribute9});10/*11This message will appear in the browser developer tools console:121314> [PayPal Insights] event "begin_checkout" - failed to register15 The event name "begin_checkout" is a valid name16 Error at: session_id. Message: 'session_id' is required.17 Error at: user_data. Message: 'user_data' object is required.18*/