Java
Copied to your clipboardMap<String, Object> reviewXdmData = new HashMap<>();reviewXdmData.put("productSku", "demo123");reviewXdmData.put("rating", 5);reviewXdmData.put("reviewText", "I love this demo!");reviewXdmData.put("reviewerId", "Anonymous user");Map<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "MyFirstXDMExperienceEvent");xdmData.put(_yourTenantId, reviewXdmData);ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).build();
Java
Copied to your clipboardEdge.sendEvent(experienceEvent, null);
Java
Syntax
Copied to your clipboardpublic static void trackAction(final String action, final Map<String, String> contextData)
Example
Copied to your clipboardMap<String, String> additionalContextData = new HashMap<String, String>();additionalContextData.put("customKey", "value");MobileCore.trackAction("loginClicked", additionalContextData);
Swift
Syntax
Copied to your clipboard+ (void) trackAction: (nullable NSString*) action data: (nullable NSDictionary*) data;
Example
Copied to your clipboardACPCore.trackAction("action name", data: ["key": "value"])
Objective-C
Syntax
Copied to your clipboard+ (void) trackAction: (nullable NSString*) action data: (nullable NSDictionary*) data;
Example
Copied to your clipboard[ACPCore trackAction:@"action name" data:@{@"key":@"value"}];
JavaScript
Syntax
Copied to your clipboardtrackAction(action?: String, contextData?: { string: string });
Example
Copied to your clipboardACPCore.trackAction("action", {"mytest": "action"});
Dart
Syntax
Copied to your clipboardFuture<void> trackAction(String action, {Map<String, String> data});
Example
Copied to your clipboardFlutterACPCore.trackAction("mytest", data: {"mytest": "action"});J
Javascript
Copied to your clipboardACPCore.trackAction("cordovaAction", {"cordovaKey":"cordovaValue"}, successCallback, errorCallback);
C#
Copied to your clipboardvar contextData = new Dictionary<string, string>();contextData.Add("key", "value");ACPCore.TrackAction("action name", contextData);
C#
iOS
Copied to your clipboardvar data = new NSMutableDictionary<NSString, NSString>{["key"] = new NSString("value")};ACPCore.TrackAction("action", data);
Android
Copied to your clipboardvar data = new Dictionary<string, string>();data.Add("key", "value");ACPCore.TrackAction("action", data);
On Android, trackState
is typically called each time a new activity is loaded.
Java
Syntax
Copied to your clipboardpublic static void trackState(final String state, final Map<String, String> contextData)
Example
Copied to your clipboardMap<String, String> additionalContextData = new HashMap<String, String>();additionalContextData.put("customKey", "value");MobileCore.trackState("homePage", additionalContextData);
Swift
Syntax
Copied to your clipboard+ (void) trackState: (nullable NSString*) state data: (nullable NSDictionary*) data;
Example
Copied to your clipboardACPCore.trackState("state name", data: ["key": "value"])
Objective-C
Syntax
Copied to your clipboard+ (void) trackState: (nullable NSString*) state data: (nullable NSDictionary*) data;
Example
Copied to your clipboard[ACPCore trackState:@"state name" data:@{@"key":@"value"}];
JavaScript
Syntax
Copied to your clipboardtrackState(state?: String, contextData?: { string: string });
Example
Copied to your clipboardACPCore.trackState("state", {"mytest": "state"});
Dart
Syntax
Copied to your clipboardFuture<void> trackState(String state, {Map<String, String> data});
Example
Copied to your clipboardFlutterACPCore.trackState("state", data: {"mytest": "state"});
Javascript
Copied to your clipboardACPCore.trackState("cordovaState", {"cordovaKey":"cordovaValue"}, successCallback, errorCallback);
C#
Copied to your clipboardvar dict = new Dictionary<string, string>();dict.Add("key", "state value");ACPCore.TrackState("state", dict);
C#
iOS
Copied to your clipboardvar data = new NSMutableDictionary<NSString, NSString>{["key"] = new NSString("value")};ACPCore.TrackState("state", data);
Android
Copied to your clipboardvar data = new Dictionary<string, string>();data.Add("key", "value");ACPCore.TrackState("state", data);