You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@logicwind/react-native-matomo-tracker is a React Native library that provides integration with the Matomo analytics platform for tracking user interactions and events in mobile applications and TV applications.
3
+
@logicwind/react-native-matomo-tracker is a React Native library that provides integration with the Matomo analytics platform for tracking user interactions and events in mobile applications and TV applications. This package supported **Android, ios, Android TV, Apple TV, Fire TV**.
4
4
5
5
With @logicwind/react-native-matomo-tracker, developers can seamlessly integrate Matomo analytics into their React Native applications, allowing them to track various user interactions such as screen views, button clicks, form submissions, and custom events. This integration enables developers to gain insights into how users interact with their mobile apps, monitor app performance, and make data-driven decisions to improve the user experience.
The createTracker function is used to instantiate a tracker object for Matomo analytics within a React Native application .It will take `matomo-url` and `siteId` parameter.
58
+
#### note
59
+
for matomo-url madatory to add `/matomo.php` end of url.
The MatomoTracker starts a new session whenever the application starts. If you want to start a new session manually, you can use the startSession() function.
73
+
74
+
#### Examples
75
+
76
+
```js
77
+
78
+
startSession()
79
+
80
+
```
81
+
82
+
83
+
### trackScreen()
84
+
85
+
The trackScreen method is used to track screen views within a React Native application. It will take `screen name` and `title` parameter.
86
+
87
+
#### Examples
88
+
20
89
```js
21
-
useEffect(()=>{
22
-
createTracker("your-matomo-url","siteid")
23
-
},[])
90
+
91
+
trackScreen("HomeScreen","Navigate to home screen")
24
92
25
93
```
26
94
95
+
### trackEvent()
96
+
97
+
The trackEvent method is used to track custom events within a React Native application. It will take `category`,`action`,`name` and `value` parameter.
98
+
99
+
#### Examples
100
+
27
101
```js
28
-
trackScreen("HomeScreen","This is test home screen")
29
102
30
103
trackEvent("test category","test action"," test name",2);
31
104
105
+
```
106
+
107
+
108
+
#### Custom data traking with track event
109
+
110
+
```js
111
+
32
112
trackEvent("basket",JSON.stringify({
33
113
id:3745092,
34
114
item:'mens grey t-shirt',
35
115
description: ['round neck', 'long sleeved'],
36
116
size:'L',
37
117
}));
38
118
119
+
```
120
+
121
+
### trackOutlink()
122
+
123
+
The trackOutlink method is used to track clicks on outbound links within a React Native application. It will take only `url` parameter.
124
+
125
+
#### Examples
126
+
127
+
```js
128
+
39
129
trackOutlink("https://www.google.com/")
40
130
41
-
trackSearch("Logicwind")
131
+
```
132
+
133
+
### trackSearch()
134
+
135
+
The trackSearch method is used to track search keyword within a React Native application. It will take only `keyword` parameter.
136
+
137
+
#### Examples
138
+
139
+
```js
140
+
141
+
trackImpression("Logicwind")
142
+
143
+
```
144
+
145
+
### trackImpression()
146
+
147
+
The trackImpression method is used to track specific content or elements within a React Native application. It will take only `contentName` parameter.
148
+
149
+
#### Examples
150
+
151
+
```js
42
152
43
153
trackImpression("Test Track Impression")
44
154
155
+
```
156
+
157
+
### trackInteraction()
158
+
159
+
The trackInteraction method is used to track users engage with specific elements or perform actions within a React Native application. It will take `contentName` and `contentInteraction` parameter.
The trackDownload method is used to track the download of files or resources within a React Native application. It will take `category`,`action` and `download-url` parameter.
By default matomo generate the unique visitor id but if you want custom vistor id then setVisitorId function allows you to manually set a custom visitor ID for tracking purposes within a React Native application . It will take `visitor-id` parameter.
The MatomoTracker will dispatch events every 30 seconds automatically. If you want to dispatch events manually, you can use the trackDispatch() function.
218
+
219
+
#### Examples
220
+
221
+
```js
61
222
62
223
trackDispatch()
63
224
64
225
```
65
226
227
+
### disableTracking()
228
+
229
+
By default the tracking is enable. If you want to disable traking, you can use the disableTracking() function.
230
+
231
+
#### Examples
232
+
233
+
```js
234
+
235
+
disableTracking()
236
+
237
+
```
238
+
239
+
### enableTracking()
240
+
241
+
The enableTracking function is used for enable traking.
242
+
243
+
#### Examples
244
+
245
+
```js
246
+
247
+
enableTracking()
248
+
249
+
```
250
+
251
+
### setLogger()
252
+
253
+
To enable logging for debugging purposes in the Matomo Android SDK and IOS SDK, you can set a custom logger. This is useful to see detailed logs of the SDK’s operations, which can help during development and troubleshooting.
254
+
255
+
#### Examples
256
+
257
+
```js
258
+
259
+
setLogger()
260
+
261
+
```
262
+
66
263
67
264
68
265
## Methods
69
266
70
267
71
-
| Name | Description |
72
-
|-----------------|-----------------|
73
-
| createTracker | The createTracker function is used to instantiate a tracker object for Matomo analytics within a React Native application. This tracker instance allows developers to track various user interactions and events within their mobile app. |
74
-
| startSession | The startSession method is used to start a new session explicitly within a React Native application.|
75
-
| trackScreen | The trackScreen method is used to track screen views within a React Native application. Screen tracking allows developers to monitor user navigation and engagement by recording when users view specific screens or pages within the app.|
76
-
| trackEvent | The trackEvent method is used to track custom events within a React Native application. Event tracking allows developers to monitor and analyze user interactions, such as button clicks, form submissions, or any other custom actions performed by users within the app. |
77
-
| trackOutlink | The trackOutlink method is used to track clicks on outbound links within a React Native application. Outbound link tracking allows developers to monitor when users click on links that navigate them away from the app to external websites or resources. |
78
-
| trackSearch | Tracking user searches in a React Native application involves capturing search queries entered by users and sending this data to your analytics platform. This enables you to understand what users are searching for within your app and how they interact with search results. |
79
-
| trackImpression | Tracking impressions in a React Native application involves capturing instances where users are exposed to specific content or elements within the app's interface. This could include advertisements, product listings, promotional banners, or any other items that are displayed to users. |
80
-
| trackInteraction | Tracking user interactions in a React Native application involves capturing instances where users engage with specific elements or perform actions within the app's interface. These interactions could include clicks on buttons, taps on links, form submissions, or any other user actions that you want to monitor. |
81
-
| trackDownload | Tracking downloads in a React Native application involves capturing instances where users initiate and complete the download of files or resources. These downloads could include documents, media files, app updates, or any other downloadable content provided within the app.|
82
-
| setUserId | The setUserId function is used to assign a unique identifier to a user in a React Native application. This identifier can be used to track user-specific actions, behavior, and engagement within the app. |
83
-
| setVisitorId | The setVisitorId function allows you to manually set a custom visitor ID for tracking purposes within a React Native application. |
84
-
| trackDispatch | The trackDispatch methods for tracking events, interactions, and other analytics-related functionalities within a React Native application. However, there isn't a standard trackDispatch method in Matomo tracking libraries, including the one provided by this package |
85
-
| setIsOptedOut | setIsOptedOut method for disabling Matomo tracking in a React Native application. |
86
-
| setLogger | setLogger method use for set up logging for Matomo SDK |
268
+
| Method | Require Paramter | Android | ios | Android TV | Apple TV |
0 commit comments