topiq-native-event-tracker
v1.0.1
Published
topiq event tracker for native apps
Readme
Topiq Native Event Tracker
Topiq Native Event Tracker is a robust and versatile tool designed to help Topiq enhance user experience by enabling personalization and recommendation features. This tracker collects critical data such as device information, session details, and IP-based location to track user events and interactions seamlessly across React Native and Expo environments.
Features
Dual Environment Support:
- Compatible with both React Native and Expo environments.
- Automatically detects and adapts to the environment for seamless functionality.
Comprehensive Device Information:
- Collects system name, device ID, manufacturer, OS version, model, and more.
Session Management:
- Tracks and manages user sessions with configurable expiration.
IP-Based Location:
- Fetches and caches user IP details to enhance personalization.
Event Tracking:
- Tracks custom events with detailed metadata for better insights.
Installation
Install the package using npm:
npm install topiq-native-event-trackerUsage
Initialize the Tracker Import and initialize the tracker with your configuration:
import createTopiqAnalytics from 'topiq-native-event-tracker';
const tracker = createTopiqAnalytics({
access_token: "your-access-token", // Required for API authentication
app_id: "your-app-id", // Unique application ID
url: "https://example.com/api/events", // API endpoint for tracking events
});
Track User Actions
Capture user interactions, such as clicks or views, to understand behavior and optimize the user experience.
tracker({
event_name: "product_view",
event_data: {
product_id: "12345",
category: "electronics",
price: 299.99,
},
});
