
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
react-native-piwik
Advanced tools
This document describes how to get started using the Piwik Tracking SDK for React Native. Piwik is the leading open source web analytics platform that gives you valuable insights into your website's visitors, your marketing campaigns and much more, so you can optimize your strategy and experience of your visitors. This relies on the native Android SDK and on the native iOS SDK for Piwik and this README page is heavily inspired by it.
Integrating Piwik into your React Native app
node_modules/react-native-piwik/ios/BNFPiwik.xcodeproj
to your xcode project, usually under the Libraries
grouplibBNFPiwik.a
(from Products
under BNFPiwik.xcodeproj
) to build target's Linked Frameworks and Libraries
listpiwiktracker.xcdatamodeld
(from Libraries
under BNFPiwik.xcodeproj/PiwikTracker
)node_modules/react-native-piwik/ios/PiwikTracker/piwiktracker.xcdatamodeld
into the folder containing AppDelegate.m
/android/settings.gradle
include ':app'
add:include ':react-native-piwik'
project(':react-native-piwik').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-piwik/android/')
android/app/build.gradle
dependencies
:compile project(':react-native-piwik')
MainApplication.java
file under android/src
import de.bonify.reactnativepiwik.PiwikPackage;
new PiwikPackage()
to the getPackages
function.Before using any function below, the tracker must be initialized.
Piwik.initTracker("https://your-piwik-domain.tld/piwik.php", 1)
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.
Piwik.setUserId("123e4567-e89b-12d3-a456-426655440000")
To send a screen view set the screen path and titles on the tracker.
Piwik.trackScreen("/your_activity", "Title")
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.
Piwik.trackEvent("category", "action", "label", 1000)
If you want to trigger a conversion manually or track some user interaction simply call the method trackGoal. Read more about what is a Goal in Piwik.
Piwik.trackGoal(1, revenue)
If you want to track the app downloads, there is also a function to do that (only supported on Android).
Piwik.trackAppDownload()
The PiwikTracker 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:
Piwik.setAppOptOut(true);
react-native-piwik is released under the MIT license, see LICENSE.
FAQs
React Native adapter for Piwik native SDKs
The npm package react-native-piwik receives a total of 5 weekly downloads. As such, react-native-piwik popularity was classified as not popular.
We found that react-native-piwik demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.