Analytics API reference
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
clearQueue
Force delete, without sending to Analytics, all hits being stored or batched on the SDK.
Use caution when manually clearing the queue. This operation cannot be reverted.
Cordova
Syntax
Copied to your clipboardACPAnalytics.clearQueue = function(success, fail);
- success is a callback containing a general success message if the clearQueue API executed without any errors.
- fail is a callback containing error information if the clearQueue API was executed with errors.
Example
Copied to your clipboardACPAnalytics.clearQueue(function (handleCallback) {console.log("AdobeExperienceSDK: Clear queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to clear queued hits: " + handleError);});
Java
Syntax
Copied to your clipboardpublic static void clearQueue()
Example
Copied to your clipboardAnalytics.clearQueue();
Swift
Syntax
Copied to your clipboardstatic func clearQueue()
Example
Copied to your clipboardACPAnalytics.clearQueue()
Objective-C
Syntax
Copied to your clipboard+ (void) clearQueue;
Example
Copied to your clipboard[ACPAnalytics clearQueue];
JavaScript
Syntax
Copied to your clipboardclearQueue();
Example
Copied to your clipboardACPAnalytics.clearQueue();
Dart
Syntax
Copied to your clipboardFuture<void> clearQueue();
Example
Copied to your clipboardFlutterACPAnalytics.clearQueue();
Cordova
Syntax
Copied to your clipboardACPAnalytics.clearQueue = function(success, fail);
- success is a callback containing a general success message if the clearQueue API executed without any errors.
- fail is a callback containing error information if the clearQueue API was executed with errors.
Example
Copied to your clipboardACPAnalytics.clearQueue(function (handleCallback) {console.log("AdobeExperienceSDK: Clear queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to clear queued hits: " + handleError);});
extensionVersion
The extensionVersion()
API returns the version of the Analytics extension that is registered with the Mobile Core extension.
To get the version of the Analytics extension, use the following code sample:
Swift
Syntax
Copied to your clipboardstatic func extensionVersion()
Example
Copied to your clipboardlet analyticsExtensionVersion = ACPAnalytics.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *analyticsExtensionVersion = [ACPAnalytics extensionVersion];
Swift
Syntax
Copied to your clipboardstatic func extensionVersion()
Example
Copied to your clipboardlet analyticsExtensionVersion = ACPAnalytics.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *analyticsExtensionVersion = [ACPAnalytics extensionVersion];
JavaScript
Copied to your clipboardACPAnalytics.extensionVersion().then(analyticsExtensionVersion => console.log("AdobeExperienceSDK: ACPAnalytics version: " + analyticsExtensionVersion));
Dart
Copied to your clipboardString analyticsExtensionVersion = await FlutterACPAnalytics.extensionVersion;
getQueueSize
Retrieves the total number of Analytics hits in the tracking queue.
Java
Syntax
Copied to your clipboardpublic static void getQueueSize(final AdobeCallback<Long> callback)
- callback is invoked with the queue size value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with queue size.
Example
Copied to your clipboardAnalytics.getQueueSize(new AdobeCallback<Long>() {@Overridepublic void call(final Long queueSize) {// handle the queueSize}});
Swift
Syntax
Copied to your clipboardstatic func getQueueSize(_ callback: @escaping (UInt) -> Void)
Example
Copied to your clipboardACPAnalytics.getQueueSize { (queueSize) in// handle queue size}
Objective-C
Syntax
Copied to your clipboard+ (void) getQueueSize: (nonnull void (^) (NSUInteger queueSize)) callback;
- callback is invoked with the queue size value.
Example
Copied to your clipboard[ACPAnalytics getQueueSize: ^(NSUInteger queueSize) {// handle queue size}];
Cordova
Syntax
Copied to your clipboardACPAnalytics.getQueueSize = function(success, fail);
- success is a callback containing the
queue size
if the getQueueSize API executed without any errors. - fail is a callback containing error information if the getQueueSize API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getQueueSize(function (handleCallback) {console.log("AdobeExperienceSDK: Queue size: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to get queue size: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetQueueSize(AdobeGetQueueSizeCallback callback)
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetQueueSizeCallback))]public static void HandleAdobeGetQueueSizeCallback(long queueSize){Debug.Log("Queue size is : " + queueSize);}ACPAnalytics.GetQueueSize(HandleAdobeGetQueueSizeCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetQueueSize (Action<nuint> callback);
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboardACPAnalytics.GetQueueSize(callback => {Console.WriteLine("Queue size: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetQueueSize (IAdobeCallback callback);
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboardACPAnalytics.GetQueueSize(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Queue size: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
Java
Syntax
Copied to your clipboardpublic static void getQueueSize(final AdobeCallback<Long> callback)
- callback is invoked with the queue size value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with queue size.
Example
Copied to your clipboardAnalytics.getQueueSize(new AdobeCallback<Long>() {@Overridepublic void call(final Long queueSize) {// handle the queueSize}});
Swift
Syntax
Copied to your clipboardstatic func getQueueSize(_ callback: @escaping (UInt) -> Void)
Example
Copied to your clipboardACPAnalytics.getQueueSize { (queueSize) in// handle queue size}
Objective-C
Syntax
Copied to your clipboard+ (void) getQueueSize: (nonnull void (^) (NSUInteger queueSize)) callback;
- callback is invoked with the queue size value.
Example
Copied to your clipboard[ACPAnalytics getQueueSize: ^(NSUInteger queueSize) {// handle queue size}];
JavaScript
Syntax
Copied to your clipboardgetQueueSize(): Promise<?integer>;
Example
Copied to your clipboardACPAnalytics.getQueueSize().then(size => console.log("AdobeExperienceSDK: Queue size: " + size));
Dart
Syntax
Copied to your clipboardFuture<int> getQueueSize;
Example
Copied to your clipboardint queueSize;try {queueSize = await FlutterACPAnalytics.queueSize;} on PlatformException {log("Failed to get the queue size");}
Cordova
Syntax
Copied to your clipboardACPAnalytics.getQueueSize = function(success, fail);
- success is a callback containing the
queue size
if the getQueueSize API executed without any errors. - fail is a callback containing error information if the getQueueSize API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getQueueSize(function (handleCallback) {console.log("AdobeExperienceSDK: Queue size: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to get queue size: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetQueueSize(AdobeGetQueueSizeCallback callback)
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetQueueSizeCallback))]public static void HandleAdobeGetQueueSizeCallback(long queueSize){Debug.Log("Queue size is : " + queueSize);}ACPAnalytics.GetQueueSize(HandleAdobeGetQueueSizeCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetQueueSize (Action<nuint> callback);
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboardACPAnalytics.GetQueueSize(callback => {Console.WriteLine("Queue size: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetQueueSize (IAdobeCallback callback);
- callback is a callback containing the
queue size
if the GetQueueSize API executed without any errors.
Example
Copied to your clipboardACPAnalytics.GetQueueSize(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Queue size: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
getQueueSizeWithCompletionHandler
Retrieves the total number of Analytics hits in the tracking queue. Invoke the callback with NSError if an unexpected error occurs or the request times out.
iOS
Swift
Syntax
Copied to your clipboardstatic func getQueueSize(completionHandler: @escaping (UInt, Error?) -> Void)
Example
Copied to your clipboardACPAnalytics.getQueueSizeWithCompletionHandler { (queueSize, error) in// Handle error (if non-nil) or use queueSize.}
Objective-C
Syntax
Copied to your clipboard+ (void) getQueueSizeWithCompletionHandler: (nonnull void (^) (NSUInteger queueSize, NSError* __nullable error)) completionHandler;
- completionHandler is invoked with the queue size value or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboard[ACPAnalytics getQueueSizeWithCompletionHandler: ^(NSUInteger queueSize, NSError * _Nullable error) {// Handle error (if non-nil) or use queueSize.}];
Swift
Syntax
Copied to your clipboardstatic func getQueueSize(completionHandler: @escaping (UInt, Error?) -> Void)
Example
Copied to your clipboardACPAnalytics.getQueueSizeWithCompletionHandler { (queueSize, error) in// Handle error (if non-nil) or use queueSize.}
Objective-C
Syntax
Copied to your clipboard+ (void) getQueueSizeWithCompletionHandler: (nonnull void (^) (NSUInteger queueSize, NSError* __nullable error)) completionHandler;
- completionHandler is invoked with the queue size value or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboard[ACPAnalytics getQueueSizeWithCompletionHandler: ^(NSUInteger queueSize, NSError * _Nullable error) {// Handle error (if non-nil) or use queueSize.}];
getTrackingIdentifier
Retrieves the Analytics tracking identifier that is generated for this app/device instance. This identifier is an app-specific, unique visitor ID that is generated at the initial launch and is stored and used after the initial launch. The ID is preserved between app upgrades and is removed when the app is uninstalled as well as on MobileCore.resetIdentities API call or on privacy status opt out.
Starting with v1.2.9 (Android) / v2.5.1 (iOS ACPAnalytics) this API does not generate or retrieve a new tracking identifier (AID) for new visitors. For the visitors which have an AID previously generated will continue retrieve the AID value with this API, and new users will use the ECID (MID) value as the primary identity.
Before using this API, see the documentation on identifying unique visitors.
Java
Syntax
Copied to your clipboardpublic static voidgetTrackingIdentifier(final AdobeCallback<String> callback)
- callback is invoked with the tracking Identifier string value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with analytics tracking identifier.
Example
Copied to your clipboardAnalytics.getTrackingIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String trackingIdentifier) {// check the trackingIdentifier value}});
Swift
Syntax
Copied to your clipboardstatic func getTrackingIdentifier(_ callback: @escaping (String?) -> Void)
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifier { (trackingIdentifier) in// check the trackingIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getTrackingIdentifier: (nonnull void (^) (NSString* __nullable trackingIdentifier)) callback;
- callback is invoked with the tracking Identifier string value.
Example
Copied to your clipboard[ACPAnalytics getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier) {// check the trackingIdentifier value}];
Cordova
Syntax
Copied to your clipboardACPAnalytics.getTrackingIdentifier = function(success, fail);
- success is a callback containing the tracking Identifier string value.
- fail is a callback containing error information if the getTrackingIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved tracking identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve tracking identifier: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetTrackingIdentifier(AdobeGetTrackingIdentifierCallback callback)
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetTrackingIdentifierCallback))]public static void HandleAdobeGetTrackingIdentifierCallback(string trackingIdentifier){Debug.Log("Tracking identifier is : " + trackingIdentifier);}ACPAnalytics.GetTrackingIdentifier(HandleAdobeGetTrackingIdentifierCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetTrackingIdentifier (Action<NSString> callback);
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetTrackingIdentifier(callback => {Console.WriteLine("Tracking identifier: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetTrackingIdentifier (IAdobeCallback callback);
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetTrackingIdentifier(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Tracking identifier: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
Java
Syntax
Copied to your clipboardpublic static voidgetTrackingIdentifier(final AdobeCallback<String> callback)
- callback is invoked with the tracking Identifier string value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with analytics tracking identifier.
Example
Copied to your clipboardAnalytics.getTrackingIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String trackingIdentifier) {// check the trackingIdentifier value}});
Swift
Syntax
Copied to your clipboardstatic func getTrackingIdentifier(_ callback: @escaping (String?) -> Void)
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifier { (trackingIdentifier) in// check the trackingIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getTrackingIdentifier: (nonnull void (^) (NSString* __nullable trackingIdentifier)) callback;
- callback is invoked with the tracking Identifier string value.
Example
Copied to your clipboard[ACPAnalytics getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier) {// check the trackingIdentifier value}];
JavaScript
Syntax
Copied to your clipboardgetTrackingIdentifier();
- callback is invoked with the tracking Identifier string value.
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifier().then(identifier => console.log("AdobeExperienceSDK: Tracking identifier: " + identifier));
Dart
Syntax
Copied to your clipboardFuture<String> getTrackingIdentifier;
Example
Copied to your clipboardString trackingId;try {trackingId = await FlutterACPAnalytics.trackingIdentifier;} on PlatformException {log("Failed to get the tracking identifier");}
Cordova
Syntax
Copied to your clipboardACPAnalytics.getTrackingIdentifier = function(success, fail);
- success is a callback containing the tracking Identifier string value.
- fail is a callback containing error information if the getTrackingIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved tracking identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve tracking identifier: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetTrackingIdentifier(AdobeGetTrackingIdentifierCallback callback)
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetTrackingIdentifierCallback))]public static void HandleAdobeGetTrackingIdentifierCallback(string trackingIdentifier){Debug.Log("Tracking identifier is : " + trackingIdentifier);}ACPAnalytics.GetTrackingIdentifier(HandleAdobeGetTrackingIdentifierCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetTrackingIdentifier (Action<NSString> callback);
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetTrackingIdentifier(callback => {Console.WriteLine("Tracking identifier: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetTrackingIdentifier (IAdobeCallback callback);
- callback is a callback containing the tracking Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetTrackingIdentifier(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Tracking identifier: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
getTrackingIdentifierWithCompletionHandler
Starting with v1.2.9 (Android) / v2.5.1 (iOS ACPAnalytics) this API does not generate or retrieve a new tracking identifier (AID) for new visitors. For the visitors which have an AID previously generated will continue retrieve the AID value with this API, and new users will use the ECID (MID) value as the primary identity.
Before you use this API, please read the documentation on identifying unique visitors.
Retrieves the Analytics tracking identifier that is generated for this app/device instance. This identifier is an app-specific, unique visitor ID that is generated at the initial launch and is stored and used after the initial launch. The ID is preserved between app upgrades and is removed when the app is uninstalled. Invoke the callback with NSError if an unexpected error occurs or the request times out.
If you have an Experience Cloud ID and have not yet configured a visitor ID grace period, the value returned by getTrackingIdentifier
may be null.
iOS
Swift
Syntax
Copied to your clipboardstatic func getTrackingIdentifier(completionHandler: @escaping (String?, Error?) -> Void)
- completionHandler is invoked with the tracking Identifier string value. or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifierWithCompletionHandler { (trackingIdentifier, error) in// Handle the error (if non-nil) or use the trackingIdentifier value.}
Objective-C
Syntax
Copied to your clipboard+ (void) getTrackingIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable trackingIdentifier, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPAnalytics getTrackingIdentifierWithCompletionHandler:^(NSString * _Nullable trackingIdentifier, NSError * _Nullable error) {// Handle the error (if non-nil) or use the trackingIdentifier value.}];
Swift
Syntax
Copied to your clipboardstatic func getTrackingIdentifier(completionHandler: @escaping (String?, Error?) -> Void)
- completionHandler is invoked with the tracking Identifier string value. or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboardACPAnalytics.getTrackingIdentifierWithCompletionHandler { (trackingIdentifier, error) in// Handle the error (if non-nil) or use the trackingIdentifier value.}
Objective-C
Syntax
Copied to your clipboard+ (void) getTrackingIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable trackingIdentifier, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPAnalytics getTrackingIdentifierWithCompletionHandler:^(NSString * _Nullable trackingIdentifier, NSError * _Nullable error) {// Handle the error (if non-nil) or use the trackingIdentifier value.}];
getVisitorIdentifier
Before using this API, see Identify unique visitors.
This API gets a custom Analytics visitor identifier, which has been set previously using setVisitorIdentifier.
Java
Syntax
Copied to your clipboardpublic static void getVisitorIdentifier(AdobeCallback<String> callback)
- callback is invoked with the visitor identifier value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with visitor identifier.
Example
Copied to your clipboardAnalytics.getVisitorIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String visitorIdentifier) {// check the visitorIdentifier value}});
Swift
Syntax
Copied to your clipboardstatic func getVisitorIdentifier(_ callback: @escaping (String?) -> Void)
- callback is invoked with the visitor identifier value.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifier { (visitorIdentifier) in// check the visitorIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getVisitorIdentifier: (nonnull void (^) (NSString* __nullable visitorIdentifier)) callback;
Example
Copied to your clipboard[ACPAnalytics getVisitorIdentifier:^(NSString * _Nullable visitorIdentifier) {// check the visitorIdentifier value}];
Cordova
Syntax
Copied to your clipboardACPAnalytics.getVisitorIdentifier = function(success, fail);
- success is a callback containing the
Visitor Identifier
string if the getVisitorIdentifier API executed without any errors. - fail is a callback containing error information if the getVisitorIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved custom visitor identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve custom visitor identifier: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetVisitorIdentifier(AdobeGetVisitorIdentifierCallback callback)
- callback is a callback containing the
Visitor Identifier
string if the GetVisitorIdentifier API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetVisitorIdentifierCallback))]public static void HandleAdobeGetVisitorIdentifierCallback(string visitorIdentifier){Debug.Log("Visitor identifier is : " + visitorIdentifier);}ACPAnalytics.GetVisitorIdentifier(HandleAdobeGetVisitorIdentifierCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetVisitorIdentifier (Action<NSString> callback);
- callback is a callback containing the visitor Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetVisitorIdentifier(callback => {Console.WriteLine("Visitor identifier: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetVisitorIdentifier (IAdobeCallback callback);
- callback is a callback containing the visitor Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetVisitorIdentifier(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Visitor identifier: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
Java
Syntax
Copied to your clipboardpublic static void getVisitorIdentifier(AdobeCallback<String> callback)
- callback is invoked with the visitor identifier value. When an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (5000ms) is met before the callback is returned with visitor identifier.
Example
Copied to your clipboardAnalytics.getVisitorIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String visitorIdentifier) {// check the visitorIdentifier value}});
Swift
Syntax
Copied to your clipboardstatic func getVisitorIdentifier(_ callback: @escaping (String?) -> Void)
- callback is invoked with the visitor identifier value.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifier { (visitorIdentifier) in// check the visitorIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getVisitorIdentifier: (nonnull void (^) (NSString* __nullable visitorIdentifier)) callback;
Example
Copied to your clipboard[ACPAnalytics getVisitorIdentifier:^(NSString * _Nullable visitorIdentifier) {// check the visitorIdentifier value}];
JavaScript
Syntax
Copied to your clipboardgetVisitorIdentifier();
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifier().then(vid => console.log("AdobeExperienceSDK: Visitor identifier: " + vid));
Dart
Syntax
Copied to your clipboardFuture<String> visitorIdentifier;
Example
Copied to your clipboardString visitorId;try {visitorId = await FlutterACPAnalytics.visitorIdentifier;} on PlatformException {visitorId = "Failed to get the visitor identifier";}
Cordova
Syntax
Copied to your clipboardACPAnalytics.getVisitorIdentifier = function(success, fail);
- success is a callback containing the
Visitor Identifier
string if the getVisitorIdentifier API executed without any errors. - fail is a callback containing error information if the getVisitorIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved custom visitor identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve custom visitor identifier: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetVisitorIdentifier(AdobeGetVisitorIdentifierCallback callback)
- callback is a callback containing the
Visitor Identifier
string if the GetVisitorIdentifier API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetVisitorIdentifierCallback))]public static void HandleAdobeGetVisitorIdentifierCallback(string visitorIdentifier){Debug.Log("Visitor identifier is : " + visitorIdentifier);}ACPAnalytics.GetVisitorIdentifier(HandleAdobeGetVisitorIdentifierCallback);
C#
iOS
Syntax
Copied to your clipboardpublic unsafe static void GetVisitorIdentifier (Action<NSString> callback);
- callback is a callback containing the visitor Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetVisitorIdentifier(callback => {Console.WriteLine("Visitor identifier: " + callback);});
Android
Syntax
Copied to your clipboardpublic unsafe static void GetVisitorIdentifier (IAdobeCallback callback);
- callback is a callback containing the visitor Identifier string value.
Example
Copied to your clipboardACPAnalytics.GetVisitorIdentifier(new StringCallback());class StringCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object stringContent){if (stringContent != null){Console.WriteLine("Visitor identifier: " + stringContent);}else{Console.WriteLine("null content in string callback");}}}
getVisitorIdentifierWithCompletionHandler
Before using this API, see Identify unique visitors.
This API gets a custom Analytics visitor identifier, which has been set previously using setVisitorIdentifier. Callback with NSError if an unexpected error occurs or the request times out.
iOS
Swift
Syntax
Copied to your clipboardstatic func getVisitorIdentifier(completionHandler: @escaping (String?, Error?) -> Void)
- completionHandler is invoked with the visitor identifier value or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifierWithCompletionHandler { (visitorIdentifier, error) in// Handle the error (if non-nil) or use the visitorIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getVisitorIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable visitorIdentifier, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPAnalytics getVisitorIdentifierWithCompletionHandler:^(NSString * _Nullable visitorIdentifier, NSError * _Nullable error) {// Handle the error (if non-nil) or use the visitorIdentifier value}];
Swift
Syntax
Copied to your clipboardstatic func getVisitorIdentifier(completionHandler: @escaping (String?, Error?) -> Void)
- completionHandler is invoked with the visitor identifier value or an NSError if an unexpected error occurs or the request times out.
Example
Copied to your clipboardACPAnalytics.getVisitorIdentifierWithCompletionHandler { (visitorIdentifier, error) in// Handle the error (if non-nil) or use the visitorIdentifier value}
Objective-C
Syntax
Copied to your clipboard+ (void) getVisitorIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable visitorIdentifier, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPAnalytics getVisitorIdentifierWithCompletionHandler:^(NSString * _Nullable visitorIdentifier, NSError * _Nullable error) {// Handle the error (if non-nil) or use the visitorIdentifier value}];
resetIdentities
Clears the identities stored in the Analytics extension - tracking identifier (AID)
and the custom visitor identifiers (VID)
stored in the Analytics extension and force deletes, without sending to Analytics, all hits being stored or batched on the SDK.
Support for this API was added in:
- Android Analytics version 1.2.9
See MobileCore.resetIdentities for more details.
sendQueuedHits
Sends all queued hits to Analytics, regardless of the current hit batch settings.
This method forces the library to send all hits in the offline queue, regardless of how many hits are currently queued.
Use caution when manually clearing the queue. This operation cannot be reverted.
Cordova
Syntax
Copied to your clipboardACPAnalytics.sendQueuedHits = function(success, fail);
- success is a callback containing a general success message if the sendQueuedHits API executed without any errors.
- fail is a callback containing error information if the sendQueuedHits API was executed with errors.
Example
Copied to your clipboardACPAnalytics.sendQueuedHits(function (handleCallback) {console.log("AdobeExperienceSDK: Send queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to send queued hits: " + handleError);});
Java
Syntax
Copied to your clipboardpublic static void sendQueuedHits()
Example
Copied to your clipboardAnalytics.sendQueuedHits();
Swift
Syntax
Copied to your clipboardstatic func sendQueuedHits()
Example
Copied to your clipboardACPAnalytics.sendQueuedHits()
Objective-C
Syntax
Copied to your clipboard+ (void) sendQueuedHits;
Example
Copied to your clipboard[ACPAnalytics sendQueuedHits];
JavaScript
Syntax
Copied to your clipboardsendQueuedHits();
Example
Copied to your clipboardACPAnalytics.sendQueuedHits();
Dart
Syntax
Copied to your clipboardFuture<void> sendQueuedHits();
Example
Copied to your clipboardFlutterACPAnalytics.sendQueuedHits();
Cordova
Syntax
Copied to your clipboardACPAnalytics.sendQueuedHits = function(success, fail);
- success is a callback containing a general success message if the sendQueuedHits API executed without any errors.
- fail is a callback containing error information if the sendQueuedHits API was executed with errors.
Example
Copied to your clipboardACPAnalytics.sendQueuedHits(function (handleCallback) {console.log("AdobeExperienceSDK: Send queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to send queued hits: " + handleError);});
setVisitorIdentifier
Before using this API, see Identify unique visitors.
Sets a custom Analytics visitor identifier. For more information, see Custom Visitor ID.
Swift
Syntax
Copied to your clipboardstatic func setVisitorIdentifier(_ visitorIdentifier: String)
- visitorIdentifier is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.setVisitorIdentifier("custom_identifier")
Objective-C
Syntax
Copied to your clipboard+ (void) setVisitorIdentifier: (nonnull NSString*) visitorIdentifier;
Example
Copied to your clipboard[ACPAnalytics setVisitorIdentifier:@"custom_identifier"];
Cordova
Syntax
Copied to your clipboardACPAnalytics.setVisitorIdentifier(visitorIdentifier, success, fail);
- visitorIdentifier is the new value for the visitor identifier.
- success is a callback containing a general success message if the setVisitorIdentifier API executed without any errors.
- fail is a callback containing error information if the setVisitorIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.setVisitorIdentifier("custom_identifier", function (handleCallback) {console.log("AdobeExperienceSDK: Custom visitor identifier set successfully. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to set custom visitor identifier: " + handleError);});
C#
iOS
Syntax
Copied to your clipboardpublic static void SetVisitorIdentifier (string visitorIdentifier);
- visitorIdentifier is the new value for the visitor identifier.
Android
Syntax
Copied to your clipboardpublic unsafe static void SetVisitorIdentifier (string visitorID);
- visitorID is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.SetVisitorIdentifier("VisitorIdentifier");
Java
Syntax
Copied to your clipboardpublic static void setVisitorIdentifier(final String visitorIdentifier)
- visitorIdentifier is the new value for the visitor identifier.
Example
Copied to your clipboardAnalytics.setVisitorIdentifier("custom_identifier");
Swift
Syntax
Copied to your clipboardstatic func setVisitorIdentifier(_ visitorIdentifier: String)
- visitorIdentifier is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.setVisitorIdentifier("custom_identifier")
Objective-C
Syntax
Copied to your clipboard+ (void) setVisitorIdentifier: (nonnull NSString*) visitorIdentifier;
Example
Copied to your clipboard[ACPAnalytics setVisitorIdentifier:@"custom_identifier"];
JavaScript
Syntax
Copied to your clipboardsetVisitorIdentifier(visitorIdentifier);
- visitorIdentifier is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.setVisitorIdentifier("custom_identifier");
Dart
Syntax
Copied to your clipboardFuture<void> setVisitorIdentifier(visitorIdentifier);
- visitorIdentifier is the new value for the visitor identifier.
Example
Copied to your clipboardFlutterACPAnalytics.setVisitorIdentifier("yourVisitorId");
Cordova
Syntax
Copied to your clipboardACPAnalytics.setVisitorIdentifier(visitorIdentifier, success, fail);
- visitorIdentifier is the new value for the visitor identifier.
- success is a callback containing a general success message if the setVisitorIdentifier API executed without any errors.
- fail is a callback containing error information if the setVisitorIdentifier API was executed with errors.
Example
Copied to your clipboardACPAnalytics.setVisitorIdentifier("custom_identifier", function (handleCallback) {console.log("AdobeExperienceSDK: Custom visitor identifier set successfully. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to set custom visitor identifier: " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void SetVisitorIdentifier(string visitorId)
- visitorId is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.SetVisitorIdentifier("VisitorIdentifier");
C#
iOS
Syntax
Copied to your clipboardpublic static void SetVisitorIdentifier (string visitorIdentifier);
- visitorIdentifier is the new value for the visitor identifier.
Android
Syntax
Copied to your clipboardpublic unsafe static void SetVisitorIdentifier (string visitorID);
- visitorID is the new value for the visitor identifier.
Example
Copied to your clipboardACPAnalytics.SetVisitorIdentifier("VisitorIdentifier");