Force delete, without sending to Analytics, all hits being stored or batched on the SDK.
ACPAnalytics.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.
Warning: Use caution when manually clearing the queue. This process cannot be reversed.
Example
ACPAnalytics.clearQueue(function (handleCallback) {console.log("AdobeExperienceSDK: Clear queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to clear queued hits: " + handleError);});
Retrieves the total number of Analytics hits in the tracking queue.
public 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.
Analytics.getQueueSize(new AdobeCallback<Long>() {@Overridepublic void call(final Long queueSize) {// handle the queueSize}});
+ (void) getQueueSize: (nonnull void (^) (NSUInteger queueSize)) callback;
callback is invoked with the queue size value.
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics getQueueSize: ^(NSUInteger queueSize) {// use queue size}];
Swift
ACPAnalytics.getQueueSize { (queueSize) in// use queue size}
Syntax
ACPAnalytics.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
ACPAnalytics.getQueueSize(function (handleCallback) {console.log("AdobeExperienceSDK: Queue size: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to get queue size: " + handleError);});
Syntax
public static void GetQueueSize(AdobeGetQueueSizeCallback callback)
callback is a callback containing the queue size
if the GetQueueSize API executed without any errors.
Example
[MonoPInvokeCallback(typeof(AdobeGetQueueSizeCallback))]public static void HandleAdobeGetQueueSizeCallback(long queueSize){Debug.Log("Queue size is : " + queueSize);}ACPAnalytics.GetQueueSize(HandleAdobeGetQueueSizeCallback);
iOS Syntax
public unsafe static void GetQueueSize (Action<nuint> callback);
callback is a callback containing the queue size
if the GetQueueSize API executed without any errors.
iOS Example
ACPAnalytics.GetQueueSize(callback => {Console.WriteLine("Queue size: " + callback);});
Android Syntax
public unsafe static void GetQueueSize (IAdobeCallback callback);
callback is a callback containing the queue size
if the GetQueueSize API executed without any errors.
Android Example
ACPAnalytics.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");}}}
Retrieves the total number of Analytics hits in the tracking queue. Invoke the callback with NSError if unexpected error occures or request times out.
+ (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.
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics getQueueSizeWithCompletionHandler: ^(NSUInteger queueSize, NSError * _Nullable error) {// use queue size or handle error}];
Swift
ACPAnalytics.getQueueSizeWithCompletionHandler { (queueSize, error) in// use queue size or handle error}
Before you use this API, see Identify 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.
If you have an Experience Cloud ID, and have not yet configured a visitor ID grace period, the value returned by getTrackingIdentifier
might be null.
Retrieves the Analytics tracking identifier.
public 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.
Analytics.getTrackingIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String trackingIdentifier) {// check the trackingIdentifier value}});
Retrieves the Analytics tracking identifier.
+ (void) getTrackingIdentifier: (nonnull void (^) (NSString* __nullable trackingIdentifier)) callback;
callback is invoked with the tracking Identifier string value.
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier) {// check the trackingIdentifier value}];
Swift
ACPAnalytics.getTrackingIdentifier { (trackingIdentifier) in// check the trackingIdentifier value}
Retrieves the Analytics tracking identifier.
Syntax
getTrackingIdentifier();
callback is invoked with the tracking Identifier string value.
Example
ACPAnalytics.getTrackingIdentifier().then(identifier => console.log("AdobeExperienceSDK: Tracking identifier: " + identifier));
Retrieves the Analytics tracking identifier.
ACPAnalytics.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
ACPAnalytics.getTrackingIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved tracking identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve tracking identifier: " + handleError);});
Retrieves the Analytics tracking identifier.
public static void GetTrackingIdentifier(AdobeGetTrackingIdentifierCallback callback)
callback is a callback containing the tracking Identifier string value.
Example
[MonoPInvokeCallback(typeof(AdobeGetTrackingIdentifierCallback))]public static void HandleAdobeGetTrackingIdentifierCallback(string trackingIdentifier){Debug.Log("Tracking identifier is : " + trackingIdentifier);}ACPAnalytics.GetTrackingIdentifier(HandleAdobeGetTrackingIdentifierCallback);
Retrieves the Analytics tracking identifier.
iOS Syntax
public unsafe static void GetTrackingIdentifier (Action<NSString> callback);
callback is a callback containing the tracking Identifier string value.
iOS Example
ACPAnalytics.GetTrackingIdentifier(callback => {Console.WriteLine("Tracking identifier: " + callback);});
Android Syntax
public unsafe static void GetTrackingIdentifier (IAdobeCallback callback);
callback is a callback containing the tracking Identifier string value.
Android Example
ACPAnalytics.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");}}}
Before you use this API, see Identify 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 unexpected error occures or 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
might be null.
+ (void) getTrackingIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable trackingIdentifier, NSError* __nullable error)) completionHandler;
completionHandler is invoked with the tracking Identifier string value. or an NSError if an unexpected error occurs or the request times out.
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics getTrackingIdentifierWithCompletionHandler:^(NSString * _Nullable trackingIdentifier, NSError * _Nullable error) {// use queue size or handle error}];
Swift
ACPAnalytics.getTrackingIdentifierWithCompletionHandler { (trackingIdentifier, error) in// use queue size or handle error}
Before using this API, see Identify unique visitors.
This API gets a custom Analytics visitor identifier, which has been set previously using setVisitorIdentifier.
public 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.
Analytics.getVisitorIdentifier(new AdobeCallback<String>() {@Overridepublic void call(final String visitorIdentifier) {// check the visitorIdentifier value}});
+ (void) getVisitorIdentifier: (nonnull void (^) (NSString* __nullable visitorIdentifier)) callback;
callback is invoked with the visitor identifier value.
Objective-C
[ACPAnalytics getVisitorIdentifier:^(NSString * _Nullable visitorIdentifier) {// check the visitorIdentifier value}];
Swift
ACPAnalytics.getVisitorIdentifier { (visitorIdentifier) in// check the visitorIdentifier value}
Syntax
ACPAnalytics.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
ACPAnalytics.getVisitorIdentifier(function (handleCallback) {console.log("AdobeExperienceSDK: Retrieved custom visitor identifier: " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve custom visitor identifier: " + handleError);});
Syntax
public static void GetVisitorIdentifier(AdobeGetVisitorIdentifierCallback callback)
callback is a callback containing the Visitor Identifier
string if the GetVisitorIdentifier API executed without any errors.
Example
[MonoPInvokeCallback(typeof(AdobeGetVisitorIdentifierCallback))]public static void HandleAdobeGetVisitorIdentifierCallback(string visitorIdentifier){Debug.Log("Visitor identifier is : " + visitorIdentifier);}ACPAnalytics.GetVisitorIdentifier(HandleAdobeGetVisitorIdentifierCallback);
iOS Syntax
public unsafe static void GetVisitorIdentifier (Action<NSString> callback);
callback is a callback containing the visitor Identifier string value.
iOS Example
ACPAnalytics.GetVisitorIdentifier(callback => {Console.WriteLine("Visitor identifier: " + callback);});
Android Syntax
public unsafe static void GetVisitorIdentifier (IAdobeCallback callback);
callback is a callback containing the visitor Identifier string value.
Android Example
ACPAnalytics.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");}}}
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.
+ (void) getVisitorIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable visitorIdentifier, NSError* __nullable error)) completionHandler;
completionHandler is invoked with the visitor identifier value or an NSError if an unexpected error occurs or the request times out.
Objective-C
[ACPAnalytics getVisitorIdentifierWithCompletionHandler:^(NSString * _Nullable visitorIdentifier, NSError * _Nullable error) {// check the visitorIdentifier value or handle error}];
Swift
ACPAnalytics.getVisitorIdentifierWithCompletionHandler { (visitorIdentifier, error) in// check the visitorIdentifier value or handle error}
Sends all queued hits to Analytics, regardless of the current hit batch settings.
Regardless of how many hits are currently queued, this method forces the library to send all hits in the offline queue.
Warning: Use caution when manually clearing the queue. This process cannot be reversed.
+ (void) sendQueuedHits;
Objective-C
[ACPAnalytics sendQueuedHits];
Swift
ACPAnalytics.sendQueuedHits()
Regardless of how many hits are currently queued, this method forces the library to send all hits in the offline queue.
Syntax
ACPAnalytics.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
ACPAnalytics.sendQueuedHits(function (handleCallback) {console.log("AdobeExperienceSDK: Send queued hits successful. " + handleCallback);} ,function (handleError) {console.log("AdobeExperenceSDK: Failed to send queued hits: " + handleError);});
Before using this API, see Identify unique visitors.
Sets a custom Analytics visitor identifier. For more information, see Custom Visitor ID.
+ (void) setVisitorIdentifier: (nonnull NSString*) visitorIdentifier;
visitorIdentifier is the new value for the visitor identifier.
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics setVisitorIdentifier:@"custom_identifier"];
Swift
ACPAnalytics.setVisitorIdentifier("custom_identifier")
Syntax
ACPAnalytics.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
ACPAnalytics.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);});
iOS Syntax
public static void SetVisitorIdentifier (string visitorIdentifier);
visitorIdentifier is the new value for the visitor identifier.
Android Syntax
public unsafe static void SetVisitorIdentifier (string visitorID);
visitorID is the new value for the visitor identifier.
Example
ACPAnalytics.SetVisitorIdentifier("VisitorIdentifier");