forked from angelaigreja/react-native-piwik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (34 loc) · 1.17 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var Matomo = require('react-native').NativeModules.Matomo;
module.exports = {
initTracker: Matomo.initTracker,
setUserId: function(userId) {
if (userId !== null && userId !== userId !== undefined) {
Matomo.setUserId(userId + '');
}
},
setCustomDimension: function(id, value){
Matomo.setCustomDimension(id, value ? (value + '') : null);
},
trackAppDownload: Matomo.trackAppDownload,
trackScreen: function(path, title) {
Matomo.trackScreen(path, title);
},
trackGoal: function(goalId, revenue) {
Matomo.trackGoal(goalId, {revenue});
},
trackEvent: function(category, action, name, value, url) {
Matomo.trackEvent(category, action, {name, value, url});
},
trackCampaign: function(name, keyword) {
Matomo.trackCampaign(name, keyword);
},
trackContentImpression: function(name, piece, target) {
Matomo.trackContentImpression(name, {piece, target});
},
trackContentInteraction: function(name, interaction, piece, target) {
Matomo.trackContentInteraction(name, {interaction, piece, target});
},
trackSearch: function(query, category, resultCount, url) {
Matomo.trackSearch(query, {category, resultCount, url});
}
};