Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@piwikpro/react-piwik-pro

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@piwikpro/react-piwik-pro - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

14

dist/constants/track-event.constant.d.ts

@@ -6,7 +6,13 @@ export declare enum TRACK_EVENT {

SEARCH = "trackSiteSearch",
ADD_ECOMMERCE_ITEM = "ecommerceAddToCart",
REMOVE_ECOMMERCE_ITEM = "ecommerceAddToCart",
ECOMMERCE_ADD_TO_CART = "ecommerceAddToCart",
ADD_ECOMMERCE_ITEM = "addEcommerceItem",
REMOVE_ECOMMERCE_ITEM = "removeEcommerceItem",
ECOMMERCE_REMOVE_FROM_CART = "ecommerceRemoveFromCart",
ECOMMERCE_PRODUCT_DETAIL_VIEW = "ecommerceProductDetailView",
UPDATE_ECOMMERCE_CART = "ecommerceCartUpdate",
ORDER_ECOMMERCE = "ecommerceOrder",
ECOMMERCE_CART_UPDATE = "ecommerceCartUpdate",
TRACK_ECOMMERCE_CART_UPDATE = "trackEcommerceCartUpdate",
TRACK_ECOMMERCE_ORDER = "trackEcommerceOrder",
ECOMMERCE_ORDER = "ecommerceOrder",
SET_ECOMMERCE_VIEW = "setEcommerceView",
CLEAR_ECOMMERCE_CART = "clearEcommerceCart",
SET_CUSTOM_VARIABLE = "setCustomVariable",

@@ -13,0 +19,0 @@ DELETE_CUSTOM_VARIABLE = "deleteCustomVariable",

@@ -40,7 +40,13 @@ function init(containerId, containerUrl, nonce) {

TRACK_EVENT["SEARCH"] = "trackSiteSearch";
TRACK_EVENT["ADD_ECOMMERCE_ITEM"] = "ecommerceAddToCart";
TRACK_EVENT["REMOVE_ECOMMERCE_ITEM"] = "ecommerceAddToCart";
TRACK_EVENT["ECOMMERCE_ADD_TO_CART"] = "ecommerceAddToCart";
TRACK_EVENT["ADD_ECOMMERCE_ITEM"] = "addEcommerceItem";
TRACK_EVENT["REMOVE_ECOMMERCE_ITEM"] = "removeEcommerceItem";
TRACK_EVENT["ECOMMERCE_REMOVE_FROM_CART"] = "ecommerceRemoveFromCart";
TRACK_EVENT["ECOMMERCE_PRODUCT_DETAIL_VIEW"] = "ecommerceProductDetailView";
TRACK_EVENT["UPDATE_ECOMMERCE_CART"] = "ecommerceCartUpdate";
TRACK_EVENT["ORDER_ECOMMERCE"] = "ecommerceOrder";
TRACK_EVENT["ECOMMERCE_CART_UPDATE"] = "ecommerceCartUpdate";
TRACK_EVENT["TRACK_ECOMMERCE_CART_UPDATE"] = "trackEcommerceCartUpdate";
TRACK_EVENT["TRACK_ECOMMERCE_ORDER"] = "trackEcommerceOrder";
TRACK_EVENT["ECOMMERCE_ORDER"] = "ecommerceOrder";
TRACK_EVENT["SET_ECOMMERCE_VIEW"] = "setEcommerceView";
TRACK_EVENT["CLEAR_ECOMMERCE_CART"] = "clearEcommerceCart";
TRACK_EVENT["SET_CUSTOM_VARIABLE"] = "setCustomVariable";

@@ -318,8 +324,14 @@ TRACK_EVENT["DELETE_CUSTOM_VARIABLE"] = "deleteCustomVariable";

function addEcommerceItem(products) {
PaqService.push([TRACK_EVENT.ADD_ECOMMERCE_ITEM, products]);
function addEcommerceItem(productSKU, productName, productCategory, productPrice, productQuantity) {
PaqService.push([TRACK_EVENT.ADD_ECOMMERCE_ITEM, productSKU, productName, productCategory, productPrice, productQuantity]);
}
function removeEcommerceItem(products) {
PaqService.push([TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, products]);
function ecommerceAddToCart(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_ADD_TO_CART, products]);
}
function removeEcommerceItem(productSKU) {
PaqService.push([TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, productSKU]);
}
function ecommerceRemoveFromCart(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_REMOVE_FROM_CART, products]);
}
function getEcommerceItems() {

@@ -338,11 +350,23 @@ return new Promise(function (resolve, reject) {

}
function trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal, orderTax, orderShipping, orderDiscount) {
PaqService.push([TRACK_EVENT.TRACK_ECOMMERCE_ORDER, orderId, orderGrandTotal, orderSubTotal, orderTax, orderShipping, orderDiscount]);
}
function ecommerceOrder(products, paymentInformation) {
PaqService.push([TRACK_EVENT.ORDER_ECOMMERCE, products, paymentInformation]);
PaqService.push([TRACK_EVENT.ECOMMERCE_ORDER, products, paymentInformation]);
}
function updateEcommerceCart(products, grandTotal) {
PaqService.push([TRACK_EVENT.UPDATE_ECOMMERCE_CART, products, grandTotal]);
function trackEcommerceCartUpdate(cartAmount) {
PaqService.push([TRACK_EVENT.TRACK_ECOMMERCE_CART_UPDATE, cartAmount]);
}
function ecommerceCartUpdate(products, grandTotal) {
PaqService.push([TRACK_EVENT.ECOMMERCE_CART_UPDATE, products, grandTotal]);
}
function ecommerceProductDetailView(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, products]);
}
function clearEcommerceCart() {
PaqService.push([TRACK_EVENT.CLEAR_ECOMMERCE_CART]);
}
function setEcommerceView(productSKU, productName, productCategory, productPrice) {
PaqService.push([TRACK_EVENT.SET_ECOMMERCE_VIEW, productSKU, productName, productCategory, productPrice]);
}

@@ -352,7 +376,13 @@ var eCommerce_service = {

addEcommerceItem: addEcommerceItem,
ecommerceAddToCart: ecommerceAddToCart,
removeEcommerceItem: removeEcommerceItem,
ecommerceRemoveFromCart: ecommerceRemoveFromCart,
getEcommerceItems: getEcommerceItems,
trackEcommerceOrder: trackEcommerceOrder,
ecommerceOrder: ecommerceOrder,
updateEcommerceCart: updateEcommerceCart,
ecommerceProductDetailView: ecommerceProductDetailView
trackEcommerceCartUpdate: trackEcommerceCartUpdate,
ecommerceCartUpdate: ecommerceCartUpdate,
ecommerceProductDetailView: ecommerceProductDetailView,
clearEcommerceCart: clearEcommerceCart,
setEcommerceView: setEcommerceView
};

@@ -359,0 +389,0 @@

@@ -40,7 +40,13 @@ function init(containerId, containerUrl, nonce) {

TRACK_EVENT["SEARCH"] = "trackSiteSearch";
TRACK_EVENT["ADD_ECOMMERCE_ITEM"] = "ecommerceAddToCart";
TRACK_EVENT["REMOVE_ECOMMERCE_ITEM"] = "ecommerceAddToCart";
TRACK_EVENT["ECOMMERCE_ADD_TO_CART"] = "ecommerceAddToCart";
TRACK_EVENT["ADD_ECOMMERCE_ITEM"] = "addEcommerceItem";
TRACK_EVENT["REMOVE_ECOMMERCE_ITEM"] = "removeEcommerceItem";
TRACK_EVENT["ECOMMERCE_REMOVE_FROM_CART"] = "ecommerceRemoveFromCart";
TRACK_EVENT["ECOMMERCE_PRODUCT_DETAIL_VIEW"] = "ecommerceProductDetailView";
TRACK_EVENT["UPDATE_ECOMMERCE_CART"] = "ecommerceCartUpdate";
TRACK_EVENT["ORDER_ECOMMERCE"] = "ecommerceOrder";
TRACK_EVENT["ECOMMERCE_CART_UPDATE"] = "ecommerceCartUpdate";
TRACK_EVENT["TRACK_ECOMMERCE_CART_UPDATE"] = "trackEcommerceCartUpdate";
TRACK_EVENT["TRACK_ECOMMERCE_ORDER"] = "trackEcommerceOrder";
TRACK_EVENT["ECOMMERCE_ORDER"] = "ecommerceOrder";
TRACK_EVENT["SET_ECOMMERCE_VIEW"] = "setEcommerceView";
TRACK_EVENT["CLEAR_ECOMMERCE_CART"] = "clearEcommerceCart";
TRACK_EVENT["SET_CUSTOM_VARIABLE"] = "setCustomVariable";

@@ -318,8 +324,14 @@ TRACK_EVENT["DELETE_CUSTOM_VARIABLE"] = "deleteCustomVariable";

function addEcommerceItem(products) {
PaqService.push([TRACK_EVENT.ADD_ECOMMERCE_ITEM, products]);
function addEcommerceItem(productSKU, productName, productCategory, productPrice, productQuantity) {
PaqService.push([TRACK_EVENT.ADD_ECOMMERCE_ITEM, productSKU, productName, productCategory, productPrice, productQuantity]);
}
function removeEcommerceItem(products) {
PaqService.push([TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, products]);
function ecommerceAddToCart(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_ADD_TO_CART, products]);
}
function removeEcommerceItem(productSKU) {
PaqService.push([TRACK_EVENT.REMOVE_ECOMMERCE_ITEM, productSKU]);
}
function ecommerceRemoveFromCart(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_REMOVE_FROM_CART, products]);
}
function getEcommerceItems() {

@@ -338,11 +350,23 @@ return new Promise(function (resolve, reject) {

}
function trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal, orderTax, orderShipping, orderDiscount) {
PaqService.push([TRACK_EVENT.TRACK_ECOMMERCE_ORDER, orderId, orderGrandTotal, orderSubTotal, orderTax, orderShipping, orderDiscount]);
}
function ecommerceOrder(products, paymentInformation) {
PaqService.push([TRACK_EVENT.ORDER_ECOMMERCE, products, paymentInformation]);
PaqService.push([TRACK_EVENT.ECOMMERCE_ORDER, products, paymentInformation]);
}
function updateEcommerceCart(products, grandTotal) {
PaqService.push([TRACK_EVENT.UPDATE_ECOMMERCE_CART, products, grandTotal]);
function trackEcommerceCartUpdate(cartAmount) {
PaqService.push([TRACK_EVENT.TRACK_ECOMMERCE_CART_UPDATE, cartAmount]);
}
function ecommerceCartUpdate(products, grandTotal) {
PaqService.push([TRACK_EVENT.ECOMMERCE_CART_UPDATE, products, grandTotal]);
}
function ecommerceProductDetailView(products) {
PaqService.push([TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, products]);
}
function clearEcommerceCart() {
PaqService.push([TRACK_EVENT.CLEAR_ECOMMERCE_CART]);
}
function setEcommerceView(productSKU, productName, productCategory, productPrice) {
PaqService.push([TRACK_EVENT.SET_ECOMMERCE_VIEW, productSKU, productName, productCategory, productPrice]);
}

@@ -352,7 +376,13 @@ var eCommerce_service = {

addEcommerceItem: addEcommerceItem,
ecommerceAddToCart: ecommerceAddToCart,
removeEcommerceItem: removeEcommerceItem,
ecommerceRemoveFromCart: ecommerceRemoveFromCart,
getEcommerceItems: getEcommerceItems,
trackEcommerceOrder: trackEcommerceOrder,
ecommerceOrder: ecommerceOrder,
updateEcommerceCart: updateEcommerceCart,
ecommerceProductDetailView: ecommerceProductDetailView
trackEcommerceCartUpdate: trackEcommerceCartUpdate,
ecommerceCartUpdate: ecommerceCartUpdate,
ecommerceProductDetailView: ecommerceProductDetailView,
clearEcommerceCart: clearEcommerceCart,
setEcommerceView: setEcommerceView
};

@@ -359,0 +389,0 @@

import { Product } from '../../interfaces/product';
import { PaymentInformation } from '../../interfaces/payment';
export declare function addEcommerceItem(products: Product[]): void;
export declare function removeEcommerceItem(products: Product[]): void;
/**
* @deprecated since version 1.3.1. Please use the ecommerceAddToCart instead.
*/
export declare function addEcommerceItem(productSKU: string, productName: string, productCategory: string | string[], productPrice: number, productQuantity: number): void;
export declare function ecommerceAddToCart(products: Product[]): void;
/**
* @deprecated since version 1.3.1. Please use the ecommerceRemoveFromCart instead.
*/
export declare function removeEcommerceItem(productSKU: string): void;
export declare function ecommerceRemoveFromCart(products: Product[]): void;
/**
* @deprecated since version 1.3.1.
*/
export declare function getEcommerceItems(): Promise<object>;
/**
* @deprecated since version 1.3.1. Please use the ecommerceOrder instead.
*/
export declare function trackEcommerceOrder(orderId: string, orderGrandTotal: number, orderSubTotal?: number, orderTax?: number, orderShipping?: number, orderDiscount?: number): void;
export declare function ecommerceOrder(products: Product[], paymentInformation: PaymentInformation): void;
export declare function updateEcommerceCart(products: Product[], grandTotal: PaymentInformation['grandTotal']): void;
/**
* @deprecated since version 1.3.1. Please use the ecommerceCartUpdate instead.
*/
export declare function trackEcommerceCartUpdate(cartAmount: number): void;
export declare function ecommerceCartUpdate(products: Product[], grandTotal: PaymentInformation['grandTotal']): void;
export declare function ecommerceProductDetailView(products: Product[]): void;
/**
* @deprecated since version 1.3.1.
*/
export declare function clearEcommerceCart(): void;
/**
* @deprecated since version 1.3.1.
*/
export declare function setEcommerceView(productSKU: string, productName?: string, productCategory?: string[], productPrice?: string): void;
{
"name": "@piwikpro/react-piwik-pro",
"version": "1.3.2",
"version": "1.3.3",
"description": "Piwik PRO tracking library for ReactJS",

@@ -5,0 +5,0 @@ "author": "Piwik Pro Integration Team <integrations@piwik.pro>",

@@ -210,7 +210,6 @@ # Piwik PRO Library for React

#### Methods
* `addEcommerceItem(products: Product[])` - Tracks action of adding products to a cart.
* `removeEcommerceItem(products: Product[])` - Tracks action of removing a product from a cart.
* `getEcommerceItems()` - Returns a copy of items from a virtual shopping cart. Does not send any data to the Collecting & Processing Pipeline
* `ecommerceAddToCart(products: Product[])` - Tracks action of adding products to a cart.
* `ecommerceRemoveFromCart(products: Product[])` - Tracks action of removing a products from a cart.
* `ecommerceOrder(products: Product[], paymentInformation: PaymentInformation)` - Tracks conversion (including products and payment details).
* `updateEcommerceCart(products: Product[], grandTotal: PaymentInformation['grandTotal'])` - Tracks current state of a cart.
* `ecommerceCartUpdate(products: Product[], grandTotal: PaymentInformation['grandTotal'])` - Tracks current state of a cart.
* `ecommerceProductDetailView(products: Product[])` - Tracks product or category view. Must be followed by a page view.

@@ -217,0 +216,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc