mrpanalytics
Client side Analytics using the W3C CEDDL Digital Data JSON.
This module is a wrapper to the global 'Analytics' lib. This module only handles event tracking - e.g. Add To Bag.
For more info on the W3C Digital Data JSON, see:
https://confluence.nap/pages/viewpage.action?pageId=18617146
Install
npm install mrpanalytics
usage
Require module
var MrpAnalytics = ;
On DOM Ready
MrpAnalytics;
- window.digitalData - Global odject containg information about the page and any products. Using the W3C CEDDL standard
- window.analytics - Global Analytics JS lib injected into the using Adobe Analytics.
Track event - e.g. Add To Bag
MrpAnalytics;
- eventJson - JSON object containing information about the event based on the following format:
- eventName - e.g. 'Add To Bag',
- effect - e.g. 'Added to bag',
- quantity
- size
- sku
Helper Properties
SITE_WIDE_EVENTS ="addToCart":"eventName": "add to cart""effect": "update cart"
Provides a list of site wide 'eventName' and 'effect' properties.