LogoLogo
HomeDashboardProduct Docs
  • Introduction
  • Core Concepts
    • Events
    • Sessions
    • User/Customer Profile
  • PLATFORM INTEGRATIONS
    • Shopify Integration
  • Sdk Integrations
    • Browser SDK
      • Integrate SDK
      • Track Events
      • Track Users
      • Configure Web Push
      • Reading Session Identifer
      • Syncing Cart Items
    • Android SDK (Coming Soon)
      • Install Android Sdk
      • Identify Customers
      • Push Notification Integration
    • iOS SDK
      • Install iOS Sdk
      • Tracking User
      • Tracking Events
      • Push Notification Settings
        • Configure APNS In Growlytics
        • Configure Mobile App For Push
        • Handling Push Click
    • Other
      • Upload Customers using CSV
  • Channel Integrations
    • Email
      • Amazon SES
      • SendGrid
      • Custom SMTP
    • Mobile Push Notifications
      • Configure FCM Channel
    • Web Push Notifications
    • Ad Networks
      • Facebook Audiences
      • Google Ad Audiences
  • REST APIs
    • Overview
    • Tracking Users (Shopify Only)
    • Tracking Users (Non-shopify)
    • Tracking Events (Shopify Only)
    • Tracking Events (Non-shopify)
    • Syncing Products
    • Mobile App Apis
  • Webhooks
    • Coupon Webhook
    • Connector Webhooks
Powered by GitBook
On this page
  • Syncing Cart
  • Cart Object
  • Cart Item Object

Was this helpful?

  1. Sdk Integrations
  2. Browser SDK

Syncing Cart Items

This article will help you to sync your customer's cart items with Growlytics.

PreviousReading Session IdentiferNextAndroid SDK (Coming Soon)

Last updated 4 years ago

Was this helpful?

With Growlytics browser SDK, you can sync customer's cart items and use it to personalize campaign messages like showing abandoned cart items or showing total cart amount etc.

Once cart items synced using Browser SDK, you can use those cart details inside Email, SMS, WhatsApp, and other campaigns.

Syncing Cart

To sync cart you can useGrowlytics.cart.sync() method. This method excepts very specific input parameters that you will need to follow.

// Sync Cart with Growlytics
Growlytics.cart.sync({
    id: '---cart id of your system goes here--',
    amount: 123,    // Total cart amount goes here,
    url: 'https://myapp.com/checkout/123324',    // Abandoned Cart URL
    items:[         // List of cart items
        {
            id: '--product id goes here--',
            name: '--product name goes here--',
            variant: '--product variant name goes here--',
            image: '--product goes here--',
            price: '--product price goes here',
            originalPrice: '--product original price - to show discount in emails',
            quantity: 2, // Number of products in cart
            notes: '--notes to show with cart items in email--'
        }
    ]
})

The input of the sync() method should exactly match with the structure mentioned above. Cart sync will fail otherwise.

Cart Object

Input Parameter

Required?

Type

Description

id

Yes

String

Cart id that you manage in your system.

amout

Yes

Decimal

Total Cart Amount

items

Yes

Array

List of all cart items.

url

Yes

String

Abandoned cart URL, to be mentioned on email, SMS, and WhatsApp campaigns.

Cart Item Object

Input Parameter

Required?

Type

Description

id

Yes

String

Id of the product added in cart.

name

Yes

String

Product Name

variant

Optional

String

Product variant name

image

Yes

String

Product Image Url

price

Yes

Decimal

Product Price

quantity

Yes

Number

Product quantity in cart.

Cart Email Preview