zence-marketing-react
v1.0.7
Published
zence-marketing-react is a React Native Android SDK designed to streamline event tracking and notifications for mobile applications. This SDK enables seamless integration with Android / iOS apps, capturing user actions like clicks, add-to-cart, purchases,
Downloads
101
Maintainers
Readme
zence-marketing-react
Description
zence-marketing-react is a React Native Android SDK designed to streamline event tracking and notifications for mobile applications. This SDK enables seamless integration with Android / iOS apps, capturing user actions like clicks, add-to-cart, purchases, and more, and sending relevant notifications in real-time. It is built with flexibility in mind, allowing for dynamic configuration and easy integration with other platforms.
Features:
Event Tracking:
Capture key user events such as clicks, installs, and purchases.
Real-Time Notifications:
Trigger notifications based on user behavior in real time.
Easy Integration:
Quickly integrate with your Android and iOS app using simple React Native commands. Customizable: Configure event-based journeys and notifications tailored to your app's needs.
Scalable:
Built to handle large-scale data capture and notification delivery.
Installation
npm install zence-marketing-reactSupporting Library, Please install this package
npm install @react-native-community/async-storage axiosFor iOS,
cd ios
pod install
cd ..Usage
Import
import zenceMarketing from "zence-marketing-react";Example of predefined events call
zenceMarketing.trigger("event-name", data);Example of custom events call
zenceMarketing.event("event-name", data);Predefined events
To enhance the performance of our app, we are tracking several important predefined events. Below is the list of these events for your review. Please take a moment to read through them and implement them in your project accordingly.
initialize() :
In the initialize() event, please ensure that you pass your app's FCM token, device ID, application ID, application secret, web site url and application name to register your app with our package.
Configuration
Note:
The appId, appSecret, and programCode should be obtained from your vendor.
The url_type should be 'Android' or 'Ios', depending on your platform
The webSiteUrl should be your App ID for Android and your Bundle ID for iOS.
Additional Device Information:
The following device-related details are included in the update:
OS Information:
osVersion: Operating system versionosName: Name of the operating systemsdkVersion: SDK version
Device Information:
deviceModel: Model of the devicemanufacturer: Device manufacturerscreenResolution: Screen resolutiontimeZone: Device time zonelocale: Device localenetworkType: Type of network connection (Wi-Fi, Mobile, etc.)carrierName: Mobile carrier nameisRooted:trueif the device is rooted, otherwisefalse
App & Installation Details:
installTime: Timestamp of when the app was installedappVersion: Current version of the app
Permissions Status:
permissions.location: Location permission status (granted/denied)permissions.notifications: Notifications permission status (granted/denied)permissions.camera: Camera permission status (granted/denied)
Device Storage:
deviceStorage.totalStorageMB: Total device storage in MBdeviceStorage.availableStorageMB: Available device storage in MB
Battery Information:
batteryLevel: Current battery percentageisCharging:trueif the device is charging, otherwisefalse
Network & Connectivity:
connectionInfo.ipAddress: Device IP addressconnectionInfo.macAddress: Device MAC address
Ensure that these values are fetched dynamically from the device environment.
Please note, this is an important event and should be considered the start of the project.zenceMarketing.trigger("initialize", {
fcmToken: value,
deviceId: value,
appId: value,
appSecret: value,
appName: value,
programCode: value,
url_type: Android or Ios,
webSiteUrl : value,
osVersion: value,
osName: value,
sdkVersion: value,
deviceModel: value,
manufacturer: value,
screenResolution: value,
timeZone: value,
locale: value,
networkType: value,
carrierName: value,
isRooted: true or false,
installTime: value,
appVersion: value,
permissions: {
location: value,
notifications: value,
camera: value
},
deviceStorage: {
totalStorageMB: value,
availableStorageMB: value
},
batteryLevel: value,
isCharging: true or false,
connectionInfo: {
ipAddress: value,
macAddress: value
}
});login() :
We kindly request that you use the login() event to track user activity within the application. The userId and userName are required, and additional values can be passed as well. The userName may be an email, phone number, or username.
zenceMarketing.trigger("login", {
userId: value,
userName: value,
name: value,
data: { ... },
timestamp: value,
deviceId: value,
appId: value,
appName: value,
webSiteUrl : value,
});register() :
We kindly ask you to implement the register() event to capture essential user registration details within the application. The userId and userName are required, and additional values can be passed as well. The userName may be an email, phone number, or username.
zenceMarketing.trigger("register", {
userId: value,
userName: value,
name: value,
data: { ... },
timestamp: value,
deviceId: value,
appId: value,
appName: value,
webSiteUrl : value,
});logout() :
We kindly request that you implement the logout event to capture when users exit the application. This event should help us track user engagement and improve our overall service.
zenceMarketing.trigger("logout", {
userId: value,
userName: value,
name: value,
timestamp: value,
deviceId: value,
appId: value,
appName: value,
webSiteUrl: value,
});Custom events
With custom events, you have the flexibility to pass any event name along with its parameters.
Sample Event:
zenceMarketing.event("button-clicked", {
userId: value,
userName: value,
name: value,
data: { ... },
timestamp: value,
deviceId: value,
appId: value,
appName: value,
webSiteUrl : value,
});With custom events, you have the flexibility to pass any event name along with its parameters.
By utilizing custom events, you can tailor the tracking to meet your specific needs and gain valuable insights into user interactions within the application.
Notification click events
If you want to trigger an event when a notification is clicked or when an in-app notification is received, you need to call the "notification-click" event and pass the data received in the notification body.
zenceMarketing.event("notification-click", data);