Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@react-native-firebase/analytics
Advanced tools
@react-native-firebase/analytics is a module for integrating Firebase Analytics into React Native applications. It allows developers to log events, set user properties, and track user interactions within their app, providing valuable insights for improving user experience and app performance.
Log Events
This feature allows you to log custom events to Firebase Analytics. The example logs an event when a product is viewed, including details like product ID, name, description, and price.
import analytics from '@react-native-firebase/analytics';
// Log a custom event
analytics().logEvent('product_view', {
id: '123456',
item: 'Product Name',
description: 'Product Description',
price: 29.99
});
Set User Properties
This feature allows you to set user properties that can be used to segment your audience in Firebase Analytics. The example sets a user property indicating the user's favorite food.
import analytics from '@react-native-firebase/analytics';
// Set a user property
analytics().setUserProperty('favorite_food', 'pizza');
Track Screen Views
This feature allows you to log screen views, which helps in understanding how users navigate through your app. The example logs a screen view for the 'HomeScreen'.
import analytics from '@react-native-firebase/analytics';
// Track a screen view
analytics().logScreenView({
screen_name: 'HomeScreen',
screen_class: 'HomeScreenClass'
});
Set User ID
This feature allows you to set a unique identifier for a user, which can be used to track user behavior across different devices and sessions. The example sets a user ID to 'user123'.
import analytics from '@react-native-firebase/analytics';
// Set a user ID
analytics().setUserId('user123');
react-native-google-analytics-bridge is a library for integrating Google Analytics into React Native applications. It provides similar functionalities like logging events and tracking screen views. However, it is specifically tailored for Google Analytics, whereas @react-native-firebase/analytics is designed for Firebase Analytics.
expo-firebase-analytics is a package for integrating Firebase Analytics into Expo-managed React Native projects. It offers similar features such as logging events and setting user properties. The main difference is that it is optimized for use with Expo, making it easier to set up in Expo environments compared to @react-native-firebase/analytics.
react-native-mixpanel is a library for integrating Mixpanel analytics into React Native applications. It provides functionalities like event tracking and user property setting. While it offers similar features, Mixpanel is a different analytics platform compared to Firebase, with its own set of tools and capabilities.
This is for the upcoming v6.0.0 release of React Native Firebase, please use the react-native-firebase package instead, unless you're early adopting/testing the new packages - in which case please use the
latest
tagged patch-only release for this package.
Analytics integrates across Firebase features and provides you with unlimited reporting for up to 500 distinct events that you can define using the Firebase SDK. Analytics reports help you understand clearly how your users behave, which enables you to make informed decisions regarding app marketing and performance optimizations.
Requires @react-native-firebase/app
to be installed.
yarn add @react-native-firebase/analytics
react-native link @react-native-firebase/analytics
Built and maintained with 💛 by Invertase.
💼 Hire Us | ☕️ Sponsor Us | 💻 Work With Us
FAQs
React Native Firebase - The analytics module provides out of the box support with Google Analytics for Firebase. Integration with the Android & iOS allows for in-depth analytical insight reporting, such as device information, location, user actions and mo
We found that @react-native-firebase/analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.