npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-matomo-gf

v0.1.5

Published

React Native wrapper for Matomo iOS and Android SDK

Downloads

15

Readme

Matomo SDK for React Native

React Native wrapper for Matomo iOS and Android SDK.

Integrated SDK-s:

Running project

Project setup

yarn

Run example app on ios:

yarn example ios

Run example app on android:

yarn example android

Tracker Usage

Not all features are supported yet. For now you can use following features

Init tracker

Before using any function below, the tracker must be initialized.

Matomo.initTracker({
  url: 'https://your-matomo-domain.tld/matomo.php',
  siteId: 1,
});

Set User ID

Providing the tracker with a user ID lets you connect data collected from multiple devices and multiple browsers for the same user. A user ID is typically a non empty string such as username, email address or UUID that uniquely identifies the user. The User ID must be the same for a given user across all her devices and browsers. If user ID is used, it must be persisted locally by the app and set directly on the tracker each time the app is started.

If no user ID is used, the SDK will generate, manage and persist a random id for you.

Matomo.setUserId('123e4567-e89b-12d3-a456-426655440000');

Passing null will delete the current user ID.

Matomo.setUserId(null);

Custom Dimensions

The Matomo SDK currently supports Custom Dimensions for the Visit Scope. Using Custom Dimensions you can add properties to the whole visit, such as "Did the user finish the tutorial?", "Is the user a paying user?" or "Which version of the Application is being used?" and such. Before sending custom dimensions please make sure Custom Dimensions are properly installed and documented. You will need the ID of your configured Dimension.

After that you can set a new Dimension,

Matomo.setCustomDimension({ id: 1, value: 'abc' });

or remove an already set dimension.

Matomo.setCustomDimension({ id: 1, value: null });

Dimensions in the Visit Scope will be sent along every Page View or Event. Custom Dimensions are not persisted by the SDK and have to be re-configured upon application startup.

Track screen views

To send a screen view set the screen path and titles on the tracker.

Matomo.trackScreen({ path: '/your_activity', title: 'Title' });

Track events

To collect data about user's interaction with interactive components of your app, like button presses or the use of a particular item in a game use trackEvent.

Matomo.trackEvent({
  category: 'category',
  action: 'action',
  name: 'label',
  value: 1000,
});

Setting App Opt Out

The MatomoTracker SDK supports opting out of tracking. Note that this flag must be set each time the app starts up and will default to false. To set the app-level opt out, use:

Matomo.setAppOptOut(true);

Track site search

To collect data about searched query in the app, use:

Matomo.trackSearch({
  query: 'the search criteria',
  category: 'some category',
  resultCount: 10,
});

Track out/download links

To collect data about outlinks:

Matomo.trackOutlink('https://helloworld.com/news/70');

To collect data about download links:

Matomo.trackDownloadLink('https://helloworld.com/files/news.pdf');

Installation

npm install react-native-matomo-gf

Usage

import Matomo from 'react-native-matomo-gf';

Matomo.initTracker({
  url: 'https://your-matomo-domain.tld/matomo.php',
  siteId: 1,
});

Matomo.trackScreen({ path: 'Home/Requests', title: null });

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT