Skip to content

Commit

Permalink
add telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
kidGodzilla committed Aug 1, 2024
1 parent 55f9985 commit 36324f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions event-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,18 @@ var EventLayer = (function EventLayer () {
});
},
},
'telemetry': { // This sends some debugging messages if enabled
enabled: true,
test: function () { return !!window.TELEMETRY && window.TELEMETRY_ENABLED },
track: function (eventName, eventProperties) {
// console.log('Track:', eventName, eventProperties);
window.TELEMETRY.track( eventName, eventProperties );
},
identify: function (userId, userProperties) {
// console.log('Track:', eventName, eventProperties);
window.TELEMETRY.identify( userId, userProperties );
},
},
'debug': { // This sends some debugging messages if enabled
enabled: true,
test: function () { return !!window.__debug },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "event-layer",
"version": "0.2.31",
"version": "0.2.32",
"description": "A very simple abstraction layer for analytics code. Write your events once, then send them where ever you want.",
"main": "event-layer.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 36324f7

Please sign in to comment.