UNPKG

@piwikpro/tracking-base-library

Version:

Piwik PRO basic tracking library for the frontend.

52 lines (51 loc) 2.13 kB
import { EcommerceOptions } from '../../interfaces'; import { PaymentInformation } from '../../interfaces/payment'; import { Product } from '../../interfaces/product'; /** * @deprecated Please use the ecommerceAddToCart instead. */ export declare function addEcommerceItem(productSKU: string, productName: string, productCategory: string | string[], productPrice: number, productQuantity: number): void; /** * Tracks action of adding products to a cart */ export declare function ecommerceAddToCart(products: Product[], options?: EcommerceOptions): void; /** * @deprecated Please use the ecommerceRemoveFromCart instead. */ export declare function removeEcommerceItem(productSKU: string): void; /** * Tracks action of removing a products from a cart */ export declare function ecommerceRemoveFromCart(products: Product[], options?: EcommerceOptions): void; /** * @deprecated */ export declare function getEcommerceItems(): Promise<object>; /** * @deprecated Please use the ecommerceOrder instead. */ export declare function trackEcommerceOrder(orderId: string, orderGrandTotal: number, orderSubTotal?: number, orderTax?: number, orderShipping?: number, orderDiscount?: number): void; /** * Tracks conversion, including products and payment details */ export declare function ecommerceOrder(products: Product[], paymentInformation: PaymentInformation, options?: EcommerceOptions): void; /** * @deprecated Please use the ecommerceCartUpdate instead. */ export declare function trackEcommerceCartUpdate(cartAmount: number): void; /** * Tracks current state of a cart */ export declare function ecommerceCartUpdate(products: Product[], grandTotal: PaymentInformation['grandTotal'], options?: EcommerceOptions): void; /** * Tracks action of viewing product page */ export declare function ecommerceProductDetailView(products: Product[], options?: EcommerceOptions): void; /** * @deprecated */ export declare function clearEcommerceCart(): void; /** * @deprecated */ export declare function setEcommerceView(productSKU: string, productName?: string, productCategory?: string[], productPrice?: string): void;