matomo-nodejs-tracker
matomo-nodejs-tracker copied to clipboard
use for React Native App tracking
I found matomo support tracking http API and provided the js client https://developer.matomo.org/api-reference/tracking-api
Instead of use https://github.com/BonifyByForteil/react-native-matomo which requires some Android/iOS SDK dependencies (not possible to do so with managed Expo environment), could I use matomo-nodejs-tracker
for React Native App tracking?
Checked the source and found the matomo-nodejs-tracker
use some nodejs API, its not possible to reuse it directly for RN mobile app.
https://github.com/matomo-org/matomo-nodejs-tracker/blob/master/index.js
But I think its possible to wrap node specific API with the frontend-compatible API, to make it work in both environment, like replace:
-
request
tofetch/axios
, -
query-string
to https://www.npmjs.com/package/query-string -
url-parse
to https://www.npmjs.com/package/url-parse -
EventEmitter
to https://www.npmjs.com/package/eventemitter3 / https://www.npmjs.com/package/events -
util.inherits
to https://www.npmjs.com/package/inherits
I have started a package to be able to track from Expo project: https://github.com/donni106/matomo-tracker-react-native
A very first integration works with manually firing the tracking of actions.
Feel free to use it and create feature requests.