@folklore/tracking
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -84,2 +84,9 @@ 'use strict'; | ||
} | ||
pushEventNow(eventName, data) { | ||
this.pushNow({ | ||
event: eventName, | ||
eventId: uuid.v4(), | ||
...data | ||
}); | ||
} | ||
trackEvent(category, action) { | ||
@@ -95,2 +102,12 @@ let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
} | ||
trackEventNow(category, action) { | ||
let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
let value = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | ||
this.pushEventNow('eventInteraction', { | ||
eventCategory: category, | ||
eventAction: action, | ||
eventLabel: label, | ||
eventValue: value | ||
}); | ||
} | ||
trackSocial(network, action) { | ||
@@ -97,0 +114,0 @@ let target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; |
@@ -75,2 +75,9 @@ import { v4 } from 'uuid'; | ||
} | ||
pushEventNow(eventName, data) { | ||
this.pushNow({ | ||
event: eventName, | ||
eventId: v4(), | ||
...data | ||
}); | ||
} | ||
trackEvent(category, action) { | ||
@@ -86,2 +93,12 @@ let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
} | ||
trackEventNow(category, action) { | ||
let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
let value = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | ||
this.pushEventNow('eventInteraction', { | ||
eventCategory: category, | ||
eventAction: action, | ||
eventLabel: label, | ||
eventValue: value | ||
}); | ||
} | ||
trackSocial(network, action) { | ||
@@ -88,0 +105,0 @@ let target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; |
{ | ||
"name": "@folklore/tracking", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "Tracking utilities", | ||
@@ -54,3 +54,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "49b1651db11afc262e3ea3326d9f0f3bc2f0a5c5" | ||
"gitHead": "9bd23dcb6eb2c28a53fa4d93326ed650a9a42393" | ||
} |
18334
571