@mableai/headless
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Mable-Headless

Mable-Headless is a custom flavour of Mable's tracking which brings support for headless and custom setups. This package provides types and utility functions to help you integrate Mable's tracking into your project and get higher conversion rates.

Installation

    npm install @mableai/headless

Usage

Basic usage

import { loadScript, MableEventName } from '@mableai/headless'

// Load the script ( you can directly load by script tag too )
await loadScript(
    'https://imon-dev.mable.ai/static/scripts/dist/swhdls.bundle.js'
)

// track a pageview
await window.wgs?.track(MableEventName.PageView, {})

Events

Event Name (MableEventName) Description Payload Type
PageView tracks page view IMableBaseData
CollectionView tracks product collection/navigation view IMableBaseData & IMableCollectionRelatedData
ProductView tracks product view IMableBaseData & IMableProductRelatedData
CartModified Tracks modification to cart data IMableBaseData & IMableCartRelatedData
CartView Tracks cart view IMableBaseData & IMableCartRelatedData
CheckoutStart Tracks checkout start IMableBaseData & IMableCheckoutRelatedData
PaymentInfoEnter Tracks payment info enter IMableBaseData & IMableCheckoutRelatedData
OrderPlaced Tracks order placed IMableBaseData & IMableCheckoutRelatedData
Lead Tracks lead IMableBaseData & IMableLeadRelatedData

Readme

Keywords

none

Package Sidebar

Install

npm i @mableai/headless

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

15.7 kB

Total Files

14

Last publish

Collaborators

  • imon-mable
  • marvin-w
  • matthias_schedel