LogoLogo
  • Home
  • Integration & SDKs
    • Web / Browser Push
      • Wordpress Integration Steps
      • Wix Integration Steps
      • Safari
        • Safari on Desktop
        • Safari on Mobile (iOS / iPadOS)
      • SDK
        • SDK Methods
        • SDK Events
        • Customizing Prompt CSS
        • AMP Support
        • E-Commerce / Abandoned Cart
    • Native App Push
      • Apple / iOS
        • P8 Key or P12 Cert Setup
        • SDK: Swift / Obj-C
          • Activity Tracking
          • Deep Linking
          • Live Activities
          • App Messages
          • Identity Synchronization
          • SDK Methods
          • SDK Delegates
        • SDK: React Native
        • SDK: Flutter
        • Advanced
          • Self-Managed Integration
        • iOS SDK Changelog
      • Android
        • Firebase App Setup
        • SDK: Kotlin / Java
          • Deep Linking
          • Activity Tracking
          • App Messages
          • Identity Synchronization
          • SDK Methods
          • SDK Callbacks
          • Live Activities
        • SDK: React Native
        • SDK: Flutter
        • Advanced
          • Self-Managed Integration
        • Android SDK Changelog
      • React Native
        • Android: Firebase App Setup
        • iOS: P8 Key or P12 Cert Setup
        • SDK: React Native
          • Deep Linking
          • Activity Tracking
          • Subscriber Matching
          • Live Activities
          • App Messages
          • SDK Methods
      • Flutter
        • Android: Firebase App Setup
        • iOS: P8 Key or P12 Cert Setup
        • SDK: Flutter
          • Deep Linking
          • Activity Tracking
          • Subscriber Matching
          • Live Activities
          • App Messages
          • SDK Methods
  • API
    • API Access Management
    • API Reference
  • Platform
    • Dashboard
    • Notifications
      • A/B Testing
      • Custom Buttons
      • Notification Previews
      • Inline Segmentation
      • Notification Templates
      • Macros
      • Native App Push Notifications
    • App Messages
    • Segments
      • Custom Geo Segmentation
    • Campaigns
    • Insights
    • User Management
    • Organizations
      • Multi-Factor Authentication
      • Single Sign On
        • Google Workspace
        • Microsoft Azure AD
        • Okta Workforce
      • Multi-Domain Notifications
      • Multi-Domain Segments
      • API Access
    • Multi-Channel Notifications
  • Info Center
    • Launch Guide & Best Practices
      • Landing Domain Whitelist
    • Web / Browser Push
      • Common Questions
      • Browser Support
      • Retrieve Push User ID
      • Not Getting Prompted
      • Not Receiving Notifications
      • How to Unsubscribe
    • Native App Push
      • Retrieve Push User ID
    • Workflow Planning
Powered by GitBook
On this page
  • E-Commerce Interactions
  • View Item
  • Add To Cart
  • Purchase
  • Update Cart
  • FAQ
  • What fields are required?
  • Do you support server-to-server events instead of providing add to cart and purchase details via the SDK?
  1. Integration & SDKs
  2. Web / Browser Push
  3. SDK

E-Commerce / Abandoned Cart

How to set up e-commerce view item, add to cart, and purchase interactions via the SDK.

In order to enable Abandoned Cart notifications we must receive information about the specific items a subscriber has viewed, added to cart, and purchased. The following guide explains how to add these user interactions via the JavaScript SDK.

The following steps assume that you are providing an item catalog/feed to our team.

If you will not be providing a product catalog item information can be provided via the inline JavaScript events. Please contact your account manager for more information on this process.

E-Commerce Interactions

There are several interactions you may provide to us to enable functionality like: Abandoned Cart Campaigns, Revenue Attribution, and Product Recommendation Campaigns:

  • View Item: Fire this interaction when a user views an item on your site.

  • Add To Cart: Fire this interaction whenever a user adds an item to their shopping cart.

  • Purchase Event: Fire this interaction after a visitor successfully completes their cart purchase.

  • Update Cart Event: Fire this interaction after a visitor makes a change to their cart.

All of the following code snippets must be ran after the SDK has been initialized.

View Item

Use this interaction to inform us whenever a visitor views an item on your site.

pushly('view_item', {
    "products": [
        {
            "id": "PRODUCT_ID"
        }
    ]
});
pushly('view_item', {
    "events": [
        {
            "id": "EVENT_ID"
        }
    ]
});

Add To Cart

Use this interaction to inform us whenever a visitor adds an item to their shopping cart.

pushly('add_to_cart', {
    "products": [
        {
            "id": "PRODUCT_ID",
            "quantity": 1
        }
    ]
});
pushly('add_to_cart', {
    "events": [
        {
            "id": "EVENT_ID",
            "quantity": 1
        }
    ]
});

You may call add_to_cart as many times as necessary to keep track of all items in a visitor's cart. Abandoned Cart notifications may be sent for any item in a customer's cart that has not been purchased.

After a purchase is made the visitor's cart will be emptied and no notifications for a purchased item will be sent to the visitor.

Purchase

Use this interaction to inform us when a visitor successfully complete's their cart purchase. Providing this interaction will ensure that visitors do not receive notifications for items they have previously purchased. This interaction will also enable revenue attribution.

It is not required to provide the list of purchased items within the purchase payload but can be provided if add to cart interactions are not implemented or to ensure cart contents are up-to-date. The price_value and purchase_id properties are also not required but it is recommended that they are provided.

pushly('purchase', {
    "products": [
        {
            "id": "PRODUCT_ID",
            "quantity": 1
        }
    ],
    "price_value": "344.33",
    "purchase_id": "ABC123"
});
pushly('purchase', {
    "events": [
        {
            "id": "EVENT_ID",
            "quantity": 1
        }
    ],
    "price_value": "344.33"
});

Update Cart

This interaction can be used to change the properties on a cart item or remove an item from the visitor's cart.

To remove an item from the cart call the update_cart method with the full current cart information (omitting the removed item):

pushly('update_cart', {
    "products": [
        {
            "id": "PRODUCT_ID",
            "quantity": 3
        }
    ]
});
pushly('update_cart', {
    "events": [
        {
            "id": "EVENT_ID",
            "quantity": 3
        }
    ]
});

Or if the cart has been completely emptied provide an empty array:

pushly('update_cart', {
    "products": []
});
pushly('update_cart', {
    "events": []
});

FAQ

What fields are required?

If you are providing a separate catalog the only required field is the item id.

Do you support server-to-server events instead of providing add to cart and purchase details via the SDK?

Yes, contact your account manager for more information on providing e-commerce events via server-side calls.

PreviousAMP SupportNextNative App Push

Last updated 1 year ago