Event Tracking
Choose your SDK version below:
- Apptrove SDK → Recommended for all projects (Latest: v2.0.0)
- Trackier SDK → Will be deprecated in May 2026 (v1.x.xx)
Use the tabs below to view event tracking code for your chosen SDK.
The Apptrove React Native SDK enables tracking of user interactions through events, providing insights into how users engage with your app. This section covers how to track built-in events, custom events, revenue events, and pass custom parameters, using event IDs retrieved from the Apptrove Panel.
Prerequisites
- Apptrove React Native SDK installed and initialized in your project
- A Apptrove MMP account with access to the Apptrove Panel
- React Native 0.60 or later
- Basic knowledge of JavaScript and React Native development
Retrieve Event ID from Dashboard
To track events, you need the event ID from the Apptrove Panel.
Steps to Retrieve Event ID
- Log in to your Apptrove Panel.
- Navigate to the Events section in the Dashboard.
- Copy the event ID for the desired built-in or custom event.
Built-in Events
Built-in events are predefined in the Apptrove dashboard and can be tracked directly using constants like ApptroveEvent.PURCHASE / TrackierEvent.PURCHASE, ApptroveEvent.ADD_TO_CART / TrackierEvent.ADD_TO_CART, etc.

Available Parameters
param1toparam10revenuecurrencyev(for custom key-value pairs)
Supported Built-in Events
LOGINREGISTERLOGOUTPURCHASECHECKOUT_STARTEDCHECKOUT_COMPLETEDADD_TO_WISHLISTCONTENT_VIEWVIEW_CARTREMOVE_FROM_CARTSEARCHPRODUCT_VIEWUPDATEINVITESHARESTART_TRIALSUBSCRIBECOMPLETE_REGISTERACHIEVEMENT_UNLOCKTUTORIAL_COMPLETEAPP_OPENTRAVEL_BOOKINGPRODUCT_SEARCHREGISTRATIONADD_TO_CARTLEVEL_ACHIEVED
Steps to Track Built-in Events
- Create an event object (
ApptroveEventorTrackierEvent) with the built-in event ID (e.g.,PURCHASE). - Optionally, set parameters like
param1,param2, or custom data. - Call the SDK's
trackEventmethod to track the event.
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating May 2026)
JavaScript Example
import React from 'react';
import { ApptroveConfig, ApptroveSDK, ApptroveEvent } from 'react-native-apptrove';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const apptroveConfig = new ApptroveConfig("xxxx-xx-4505-bc8b-xx", ApptroveConfig.EnvironmentDevelopment);
ApptroveSDK.initialize(apptroveConfig);
const trackBuiltInEvent = () => {
const apptroveEvent = new ApptroveEvent(ApptroveEvent.PURCHASE); // Built-in event
apptroveEvent.param1 = "XXXXXX";
apptroveEvent.param2 = "kkkkkkk";
ApptroveSDK.trackEvent(apptroveEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackBuiltInEvent}>
<Text>Track Built-in Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
JavaScript Example
import React from 'react';
import { TrackierConfig, TrackierSDK, TrackierEvent } from 'react-native-trackier';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const trackierConfig = new TrackierConfig("xxxx-xx-4505-bc8b-xx", TrackierConfig.EnvironmentDevelopment);
TrackierSDK.initialize(trackierConfig);
const trackBuiltInEvent = () => {
const trackierEvent = new TrackierEvent(TrackierEvent.PURCHASE); // Built-in event
trackierEvent.param1 = "XXXXXX";
trackierEvent.param2 = "kkkkkkk";
TrackierSDK.trackEvent(trackierEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackBuiltInEvent}>
<Text>Track Built-in Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
Custom Events
Custom events are user-defined in the Apptrove Panel to track app-specific actions tailored to your business logic.

Steps to Track Custom Events
- Create a custom event in the Apptrove Panel under the Events section.
- Note the event ID for the custom event.
- Use the event class (
ApptroveEventorTrackierEvent) with the custom event ID to track the event.
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating May 2026)
import React from 'react';
import { ApptroveConfig, ApptroveSDK, ApptroveEvent } from 'react-native-apptrove';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const apptroveConfig = new ApptroveConfig("xxxx-xx-4505-bc8b-xx", ApptroveConfig.EnvironmentDevelopment);
ApptroveSDK.initialize(apptroveConfig);
const trackCustomEvent = () => {
const apptroveEvent = new ApptroveEvent("sEMWSCTXeu"); // Custom event ID from Panel
apptroveEvent.param1 = "XXXXXX";
apptroveEvent.param2 = "kkkkkkk";
const value = { id: 1, phone: "+91-8130XXX721", name: "Embassies" };
apptroveEvent.setEventValue("data", value);
ApptroveSDK.trackEvent(apptroveEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackCustomEvent}>
<Text>Track Custom Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
JavaScript Example
import React from 'react';
import { TrackierConfig, TrackierSDK, TrackierEvent } from 'react-native-trackier';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const trackierConfig = new TrackierConfig("xxxx-xx-4505-bc8b-xx", TrackierConfig.EnvironmentDevelopment);
TrackierSDK.initialize(trackierConfig);
const trackCustomEvent = () => {
const trackierEvent = new TrackierEvent("sEMWSCTXeu"); // Custom event ID from Panel
trackierEvent.param1 = "XXXXXX";
trackierEvent.param2 = "kkkkkkk";
const value = { id: 1, phone: "+91-8130XXX721", name: "Embassies" };
trackierEvent.setEventValue("data", value);
TrackierSDK.trackEvent(trackierEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackCustomEvent}>
<Text>Track Custom Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
3. Complete Event Tracking Example
This comprehensive example demonstrates how to track a COMPLETE_REGISTRATION event with all available parameters, user data, and custom attributes.
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating May 2026)
function trackCompleteRegistration() {
// Note: Ensure ApptroveSDK.initialize is called before tracking events.
const event = new ApptroveEvent(ApptroveEvent.COMPLETE_REGISTRATION);
// Alternatively: const event = new ApptroveEvent("YOUR_EVENT_ID");
event.orderId = "REG_001";
event.productId = "FREE_PLAN";
event.couponCode = "343434234";
event.discount = 3.1415;
event.revenue = 34234234.32423;
event.currency = "USD";
event.param1 = "Test1";
event.param2 = "Test2";
event.param3 = "Test3";
event.param4 = "Test4";
event.param5 = "Test5";
event.param6 = "Test6";
event.param7 = "Test7";
event.param8 = "Test8";
event.param9 = "Test9";
event.param10 = "Test10";
const jsonData = { url: "+91-8130300721", name: "Embassies" };
event.setEventValue("data", JSON.stringify(jsonData));
event.setEventValue("signup_time", 1631234567890);
event.setEventValue("sdk", "ReactNative");
ApptroveSDK.setUserId("USER123");
ApptroveSDK.setUserEmail("user@example.com");
ApptroveSDK.setUserName("Jane Doe");
ApptroveSDK.setUserPhone("+1234567890");
ApptroveSDK.setIMEI("123456789012345", "987654321098765");
ApptroveSDK.setMacAddress("00:1A:2B:3C:4D:5E");
const userDetails = { Plan: "FREE_PLAN", SignupMethod: "Email", AppVersion: "1.0.0", DOB: "1990-01-01", Gender: "Male" };
ApptroveSDK.setUserAdditionalDetails("userDetails", JSON.stringify(userDetails));
ApptroveSDK.trackEvent(event);
}
function trackCompleteRegistration() {
// Note: Ensure TrackierSDK.initialize is called before tracking events.
const event = new TrackierEvent(TrackierEvent.COMPLETE_REGISTRATION);
// Alternatively: const event = new TrackierEvent("w43424");
event.orderId = "REG_001";
event.productId = "FREE_PLAN";
event.couponCode = "343434234";
event.discount = 3.1415;
event.revenue = 34234234.32423;
event.currency = "USD";
event.param1 = "Test1";
event.param2 = "Test2";
event.param3 = "Test3";
event.param4 = "Test4";
event.param5 = "Test5";
event.param6 = "Test6";
event.param7 = "Test7";
event.param8 = "Test8";
event.param9 = "Test9";
event.param10 = "Test10";
const jsonData = { url: "+91-8130300721", name: "Embassies" };
event.ev = jsonData;
event.setEventValue("signup_time", 1631234567890);
event.setEventValue("sdk", "ReactNative");
TrackierSDK.setUserId("USER123");
TrackierSDK.setUserEmail("user@example.com");
TrackierSDK.setUserName("Jane Doe");
TrackierSDK.setUserPhone("+1234567890");
TrackierSDK.setIMEI("123456789012345", "987654321098765");
TrackierSDK.setMacAddress("00:1A:2B:3C:4D:5E");
const userDetails = { Plan: "FREE_PLAN", SignupMethod: "Email", AppVersion: "1.0.0", DOB: "1990-01-01", Gender: "Male" };
TrackierSDK.setUserAdditionalDetails("userDetails", userDetails);
TrackierSDK.trackEvent(event);
}
4. Revenue Events
Revenue events allow you to track in-app revenue, including the amount and currency, to monitor monetization performance.
Steps to Track Revenue Events
- Create an event object with the event ID (e.g.,
PURCHASE). - Set the
revenueandcurrencyproperties. - Call the SDK's
trackEventto track the revenue event.
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating May 2026)
JavaScript Example
import React from 'react';
import { ApptroveConfig, ApptroveSDK, ApptroveEvent } from 'react-native-apptrove';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const apptroveConfig = new ApptroveConfig("xxxx-xx-4505-bc8b-xx", ApptroveConfig.EnvironmentDevelopment);
ApptroveSDK.initialize(apptroveConfig);
const trackRevenueEvent = () => {
const revenueEvent = new ApptroveEvent(ApptroveEvent.PURCHASE);
revenueEvent.param1 = "XXXXXX";
revenueEvent.param2 = "kkkkkkk";
revenueEvent.revenue = 2.5;
revenueEvent.currency = "USD";
ApptroveSDK.trackEvent(revenueEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackRevenueEvent}>
<Text>Track Revenue Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
JavaScript Example
import React from 'react';
import { TrackierConfig, TrackierSDK, TrackierEvent } from 'react-native-trackier';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const trackierConfig = new TrackierConfig("xxxx-xx-4505-bc8b-xx", TrackierConfig.EnvironmentDevelopment);
TrackierSDK.initialize(trackierConfig);
const trackRevenueEvent = () => {
const revenueEvent = new TrackierEvent(TrackierEvent.PURCHASE);
revenueEvent.param1 = "XXXXXX";
revenueEvent.param2 = "kkkkkkk";
revenueEvent.revenue = 2.5;
revenueEvent.currency = "USD";
TrackierSDK.trackEvent(revenueEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackRevenueEvent}>
<Text>Track Revenue Event</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
Custom Parameters
Custom parameters allow you to add additional key-value pairs to events for richer context and analytics.
Steps to Add Custom Parameters
- Create an event object with the event ID.
- Add custom data (e.g., assign to
evor usesetEventValue). - Track the event using the SDK's
trackEvent.
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating May 2026)
JavaScript Example
import React from 'react';
import { ApptroveConfig, ApptroveSDK, ApptroveEvent } from 'react-native-apptrove';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const apptroveConfig = new ApptroveConfig("xxxx-xx-4505-bc8b-xx", ApptroveConfig.EnvironmentDevelopment);
ApptroveSDK.initialize(apptroveConfig);
const trackCustomParamsEvent = () => {
const apptroveEvent = new ApptroveEvent("sEMWSCTXeu"); // Custom event ID from Panel
const jsonData = { phone: "+91-8137872378", name: "Embassies" };
apptroveEvent.setEventValue("data", JSON.stringify(jsonData));
ApptroveSDK.trackEvent(apptroveEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackCustomParamsEvent}>
<Text>Track Event with Custom Params</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
JavaScript Example
import React from 'react';
import { TrackierConfig, TrackierSDK, TrackierEvent } from 'react-native-trackier';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
export default function App() {
const trackierConfig = new TrackierConfig("xxxx-xx-4505-bc8b-xx", TrackierConfig.EnvironmentDevelopment);
TrackierSDK.initialize(trackierConfig);
const trackCustomParamsEvent = () => {
const trackierEvent = new TrackierEvent("sEMWSCTXeu"); // Custom event ID for "AppOpen"
const jsonData = { phone: "+91-8137872378", name: "Embassies" };
trackierEvent.ev = jsonData;
TrackierSDK.trackEvent(trackierEvent);
};
return (
<View style={styles.container}>
<TouchableHighlight style={styles.button} onPress={trackCustomParamsEvent}>
<Text>Track Event with Custom Params</Text>
</TouchableHighlight>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1, alignItems: 'center', justifyContent: 'center' },
button: { padding: 10, backgroundColor: '#ddd' },
});
Best Practices
- Validate Event IDs: Ensure event IDs are correctly copied from the Apptrove Panel to avoid tracking errors.
- Use Descriptive Parameters: Set meaningful values for
param1toparam10and custom parameters to facilitate analytics. - Test in Development Mode: Use
ApptroveConfig.EnvironmentDevelopmentorTrackierConfig.EnvironmentDevelopmentduring testing to verify event tracking without affecting production data. - Monitor Event Limits: Avoid excessive event tracking to stay within Apptrove usage limits; prioritize key user actions.
- Log Events for Debugging: Use
console.logto confirm events are triggered and sent correctly during development. - Comply with Privacy Regulations: Ensure event data (e.g., revenue, custom parameters) complies with GDPR, CCPA, and other privacy laws.
Troubleshooting
- Events Not Appearing in Dashboard:
- Verify the event ID matches the one in the Apptrove Panel.
- Ensure the SDK is initialized before tracking events.
- Check that the environment (
EnvironmentDevelopmentorEnvironmentProduction) matches the dashboard settings.
- Custom Parameters Not Tracked:
- Confirm the
evproperty is assigned a valid JavaScript object with supported key-value pairs. - Check for syntax errors in the
jsonDataobject.
- Confirm the
- Revenue Tracking Issues:
- Verify the
revenueandcurrencyvalues are correctly set and use supported currency codes (e.g.,"USD","INR").
- Verify the
- General Issues:
- Check the console logs for errors related to
ApptroveSDK.trackEventorTrackierSDK.trackEvent.
- Check the console logs for errors related to
For further assistance, refer to the Apptrove Documentation Portal or contact support at support@apptrove.com.