electron-google-analytics
Advanced tools
Comparing version 0.0.14 to 0.0.15
{ | ||
"name": "electron-google-analytics", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "A library to implement Google Analytics in desktop apps.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -16,2 +16,4 @@ ### Google Analytics - [Measurement Protocol API](https://developers.google.com/analytics/devguides/collection/protocol/v1/) | ||
* Refund | ||
* Item | ||
* User Timing Tracking | ||
* Custom function for the rest (send) | ||
@@ -102,3 +104,3 @@ | ||
``` | ||
* Refund | ||
@@ -115,2 +117,24 @@ | ||
* Item | ||
`Analytics#item(trnID, itemName, { itemPrice, itemQty, itemSku, itemVariation, currCode } = {}, clientID)` | ||
```javascript | ||
return analytics.item(123, 'Test item').then((response) => { | ||
return response; | ||
}).catch((err) => { | ||
return err; | ||
}); | ||
``` | ||
* User Timing Tracking | ||
`Analytics#timingTrk(timingCtg, timingVar, timingTime, { timingLbl, dns, pageDownTime, redirTime, tcpConnTime, serverResTime } = {}, clientID)` | ||
```javascript | ||
return analytics.timingTrk('Category', 'jsonLoader').then((response) => { | ||
return response; | ||
}).catch((err) => { | ||
return err; | ||
}); | ||
``` | ||
* Send (for everything else for now) | ||
@@ -117,0 +141,0 @@ |
@@ -95,3 +95,3 @@ import chai from 'chai'; | ||
return analytics.item('Category', 'jsonLoader').then((response) => { | ||
return analytics.timingTrk('Category', 'jsonLoader').then((response) => { | ||
return expect(response).to.have.property('clientID'); | ||
@@ -201,3 +201,3 @@ }).catch((err) => { | ||
return analytics.item('Category', 'jsonLoader').then((response) => { | ||
return analytics.timingTrk('Category', 'jsonLoader').then((response) => { | ||
return expect(response).to.be.empty; | ||
@@ -204,0 +204,0 @@ }).catch((err) => { |
34932
155