Configuring Analytics via Clevertap
Step 1: Base code
Add This code in a new dart file clever_tap_api.dart
import 'package:clevertap_plugin/clevertap_plugin.dart';
import 'package:smartech_nudges/netcore_px.dart';
class CleverTapAPI{
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, "ctp", payload);
payload.addAll(data);
//Send Px data to your analytics partner
CleverTapPlugin.recordEvent(eventName, payload);
}
}
Step 2: Update the code as shown below
For all those events on which you want to track the impact of Hansel changes, make the updates as suggested in the snippet below:
//If the original code was
CleverTapPlugin.recordEvent("Bottom_Nav", <String,Object>{});
//it would get updated to
CleverTapAPI.recordEvent("Bottom_Nav", <String,Object>{});
Updated 4 months ago