Configuring Other Analytics Provider
Step 1: Create new Class
Create a new method recordEvent
in class tracker_api.dart
import 'package:smartech_nudges/netcore_px.dart';
class AnalyticsAPI{
static Future<void> recordEvent(String eventName, Map<String,Object> payload) async {
//Log event with Smartech PX
Map<String,Object> data = await NetcorePX.instance.logEvent(eventName, "partner_short_name", payload);
payload.addAll(data);
//Send Px data to your analytics partner, AnalyticsTracker is instance of your analytics partner
AnalyticsTracker.recordEvent(eventName, payload);
}
}
To get your analytics partner short name, please contact administrator.
Step 2: Using the new method
For all those events which can work as triggers for nudges or can be the goal events for the nudges, make the updates as suggested in the snippet below:
// If the snippet in code was, AnalyticsTracker is your anayltics partner instance
AnalyticsAPI.recordEvent(eventName, properties)
// update it to
AnalyticsAPI.recordEvent(eventName, properties)
Updated 3 months ago