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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mytracker/react-native-mytracker

v1.1.0

Published

MyTracker SDK for React Native Framework

Downloads

340

Readme

myTracker React Native SDK

Platforms License

myTracker — free mobile analytics for iOS and Android platforms. Get connected to know everything about your apps, audience and advertising campaigns.

Integrate

Installation

  • NPM

    Add the following line to your package.json file in a dependencies key:

    	"@mytracker/react-native-mytracker": "1.0.x"
  • Imports

    To use MyTracker in your app import RNMyTracker:

    	import RNMyTracker from '@mytracker/react-native-mytracker';

    If you have to use StoreKit purchases you also have to import special classes:

    	import { StoreKitProduct, StoreKitProductDiscount, StoreKitProductSubscriptionPeriod, StoreKitTransaction } from '@mytracker/react-native-mytracker';

Usage

Initialization

const myTracker = RNMyTracker;
myTracker.setDebugMode(true); // enable/disable debug mode, false by default
myTracker.initTracker('your_sdk_key'); // sdk key that you can get in your myTracker account

Parameters and configuration

const config = myTracker.getTrackerConfig() 

The method returns tracker configuration.

Configuration

config.getTrackingLaunchEnabled() 
// isEnabled: required, bool
config.setTrackingLaunchEnabled(isEnabled) 

App launch tracking. True by default.

config.getLaunchTimeout() 
// seconds: required, number in range
config.setLaunchTimeout(seconds) 

An interval (in seconds) during which a new launch is not tracked and a session is not interrupted while app is in background. 30 seconds by default. Possible value range: 30-7200 seconds.

config.getBufferingPeriod() 
// seconds: required, number in range
config.setBufferingPeriod(seconds) 

The time during which events are accumulated locally on the device before being sent to the MyTracker server. The default value is 900 seconds, allowed values are: 1-86400 seconds (1 day).

config.getForcingPeriod() 
// seconds: required, number in range
config.setForcingPeriod(seconds) 

An interval (in seconds) starting from application install/update during which any new event will be sent to the server immediately, without local buffering. Default value is set to 0 (immediate sending is disabled), allowed values are 0-432000 seconds (5 days).

config.getAutotrackingPurchaseEnabled() 
// isEnabled: required, boolean
config.setAutotrackingPurchaseEnabled(isEnabled)

If inApp purchase events should be tracked automatically. True by default.

config.getTrackingLocation() 
// mode: required, enum from getConstants.LOCATION
config.setTrackingLocation(mode)

Geolocation tracking. False by default. If your application requests location access, you can enable this parameter to improve an accuracy of statistics related to the user geography. In some cases, location tracking also improves attribution and predictive models (Fraud Scanner, Personalize, LTV Predictions, etc.).

config.getRegion() 
// region: required, enum from getConstants.REGION
config.setRegion(region) 

Since March 1, 2023, the region parameter is disabled. Regardless of the selected value, the data will be sent to servers located in the Russian Federation. To select a different region, please contact our support team

Where the data collection server is located.

const configConstants = config.getConstants()

Collection of constants:

configConstants.LOCATION.NONE
configConstants.LOCATION.ACTIVE
configConstants.LOCATION.CACHED

configConstants.REGION.RU
configConstants.REGION.EU
configConstants.REGION.REGION_NOT_SET

Parameters

const params = myTracker.getTrackerParams() 

The method returns tracker parameters.

// gender: required, enum from getConstants().GENDER
params.setGender(gender) 

Sets user's gender.

// age: required, number
params.setAge(age) 

Sets user's age.

// language: required, string
params.setLanguage(language) 

Sets user's language.

// customUserIds: required, array
params.setCustomUserIds(customUserIds) 

Sets user's custom identifier.

const constants = getConstants() 

Returns constants like:

constants.GENDER.UNSPECIFIED
constants.GENDER.UNKNOWN
constants.GENDER.MALE
constants.GENDER.FEMAL

Events

// userId: required, string
myTracker.trackRegistrationEvent(userId) 

Track registration event.

// userId: required, string
myTracker.trackLoginEvent(userId) 

Track login event.

// eventParams: optional, Map<key: string_255, value: string_255>
myTracker.trackInviteEvent(eventParams) 

Track invite event.

// level: optional, number
// eventParams: optional, Map<key: string_255, value: string_255>
myTracker.trackLevelAchieved(level, eventParams) 

The method keeps track level achievement event, in a game for example.

// name: required, string_255
// eventParams: optional, Map<key: string_255, value: string_255>
myTracker.trackEvent(name, eventParams) 

The method can track custom event with name and event parameters.

// product: required, StoreKitProduct
// transaction: required, StoreKitTransaction
// eventParams: optional, Map<key: string_255, value: string_255>
myTracker.trackStoreKitPurchase(product, transaction, eventParams) 

The method iOS only, track purchase event if purchase autotracking disabled.

// skuDetails: required, Map
// purchaseData: required, Map
// dataSignature: required, String
// eventParams: optional, Map<key: string_255, value: string_255>
myTracker.trackGooglePlayPurchase(skuDetails, purchaseData, dataSignature, eventParams) 

The method Android only, track purchase event if purchase autotracking disabled. Only for Google purchases.

// resultCode: required, number
// purchaseData: required, Map
// dataSignature: required, String
myTracker.onActivityResult(resultCode, purchaseData, dataSignature)

If you use you own In-App Billing API implementation or Huawei In-App Purchases API, for automatic purchase events tracking you should call the corresponding MyTracker method from onActivityResult method of activity that started the purchase process.

// responseCode: required, number
// purchaseData: required, Map
// dataSignature: required, String
myTracker.onPurchasesUpdated(responseCode, purchaseData, dataSignature) 

If you use the Google Play Billing Library, for automatic purchase events tracking you should call the corresponding MyTracker method from onPurchasesUpdated method of BillingClient listener.

Other

myTracker.getInstanceId() 

The method returns instance ID.

myTracker.flush() 

The method forcibly sends events.