Integrate the SDK
Integrate the Pushwoosh SDK to complete the configuration process
Once you authorized and gave all the necessary permissions to Pushwoosh, implement the Abandoned Cart Recovery into your site:
integrate Pushwoosh SDK to enable Abandoned Cart Recovery service for your website,
add Facebook Checkbox plugin to let users opt-in for receiving messages,
trigger Events to track user behavior and gain statistics.
Integrate Pushwoosh SDK
Include the Pushwoosh SDK from our CDN:
Make sure to locate the following code to the <head> element of your HTML.
2. Initialize the SDK by integrating the code snippet from the setup wizard into your site.
Locate the PWSDK
variable to the <head> element of your HTML.
The code snippet initializes the Pushwoosh Facebook SDK for your website. Pushwoosh SDK is enabled to register users, trigger events, and send automated messages on behalf of the Facebook page you give access to.
Add Facebook Checkbox plugin
To let Pushwoosh know about users who agreed to receive updates via Facebook Messenger, use the Facebook Checkbox plugin. To render the Facebook Checkbox, add an empty div
with class 'pwasc-container' to your site:
When a user checks the Facebook Checkbox, the Opt-in
event is triggered (provided that the cartUpdated
or purchaseCompleted
follows the checkbox checking).
Best practice
Place the Facebook Checkbox above the Add to Cart button to provide a clear understanding of the checkbox purpose. This best practice is recommended by Facebook.
Customize the checkbox appearance using the following parameters:
ASCSize: large (default), small, medium, standard, xlarge.
ASCSkin: light (default), dark. Dark skin is preferable for dark-backgrounded sites.
ASCAlignCenter: false (default), true. By default, the components of the checkbox are left-aligned.
ASCAllowLogin: false (default), true. By default, the checkbox is visible only for users who have logged into Facebook already. When set to ’true', the checkbox is rendered for all users including those not logged in. Logged in users will also see a "Not you?" option.
Customizing checkbox is available via init params.
Trigger Events
To track user actions and send messages based on users' behavior, trigger the following events:
Opt-in
Opt-in event is triggered when a user agrees to receive messages on Messenger.
Facebook requires clear affirmative action to be performed by a user to allow receiving messages. For that reason, users are considered opted-in when they check the Facebook Checkbox and confirm their consent by adding products to their cart or making a purchase. The Opt-in
event is triggered when cartUpdated
or purchaseCompleted
event takes place after a user checks the Facebook Checkbox.
cartUpdated
Trigger this event whenever a customer updates their cart (either by adding or removing products). The cartUpdated event contains the following data: a) the total cost of all products in the cart, b) details of each product in the cart:
Pushwoosh starts the Abandoned Cart Recovery messages flow on the cartUpdated event (after the specified delay time expires).
cartCleared
Trigger this event whenever a customer removes all products from their cart. Once a cartCleared
event is received by Pushwoosh SDK, Pushwoosh stops sending Abandoned Cart reminders to the user.
purchaseCompleted
Trigger this event whenever a customer successfully completes their purchase. The purchaseCompleted event contains the number of purchased products as well as the total cost of a purchase. Pushwoosh stops sending Abandoned Cart Recovery messages to users who complete their purchases.
Pushwoosh tracks and stores all the events data. The corresponding metrics are presented in the Reports section of your Abandoned Cart Recovery service.
Once everything's set up, go back to Abandoned Cart Recovery dashboard to create your reminders flow.
Last updated