Sends all queued hits to Analytics, regardless of the current hit batch settings.
{% tabs %} {% tab title="Android" %}
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.
public static void sendQueuedHits()
Analytics.sendQueuedHits();
{% endtab %}
{% tab title="iOS" %}
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;
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics sendQueuedHits];
Swift
ACPAnalytics.sendQueuedHits()
{% endtab %}
{% tab title="React Native" %}
Regardless of how many hits are currently queued, this method forces the library to send all hits in the offline queue.
ACPAnalytics.sendQueuedHits();
{% endtab %} {% endtabs %}
Force delete, without sending to Analytics, all hits being stored or batched on the SDK.
{% tabs %} {% tab title="Android" %}
Warning: Use caution when manually clearing the queue. This process cannot be reversed.
public static void clearQueue()
Analytics.clearQueue();
{% endtab %}
{% tab title="iOS" %}
Warning: Use caution when manually clearing the queue. This process cannot be reversed.
+ (void) clearQueue;
[ACPAnalytics clearQueue];
ACPAnalytics.clearQueue()
{% endtab %}
{% tab title="React Native" %}
Warning: Use caution when manually clearing the queue. This process cannot be reversed.
ACPAnalytics.clearQueue();
{% endtab %} {% endtabs %}
Retrieves the total number of Analytics hits In the tracking queue.
{% tabs %} {% tab title="Android" %}
public static void getQueueSize(final AdobeCallback<Long> callback)
Analytics.getQueueSize(new AdobeCallback<Long>() {
@Override
public void call(final Long queueSize) {
// handle the queueSize
}
});
{% endtab %}
{% tab title="iOS" %}
+ (void) getQueueSize: (nonnull void (^) (NSUInteger queueSize)) callback;
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
}
{% endtab %}
{% tab title="React Native" %}
ACPAnalytics.getQueueSize().then(size => console.log("AdobeExperienceSDK: Queue size: " + size));
{% endtab %} {% endtabs %}
{% hint style="warning" %} Please review Adobe Analytics's Visitor ID Order documentation before using this API. {% endhint %}
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.
{% hint style="info" %}
If you have an Experience Cloud ID, and do not have visitor ID grace period configured, the value returned by getTrackingIdentifier
might be null.
{% endhint %}
{% tabs %} {% tab title="Android" %}
Retrieves the Analytics tracking identifier.
public static void
getTrackingIdentifier(final AdobeCallback<String> callback)
AdobeCallback<String> trackingIdentifierCallback = new AdobeCallback<String>() {
@Override
public void call(final String trackingIdentifier) {
// check the trackingIdentifier value
}
};
Analytics.getTrackingIdentifier(analyticsTrackingIdentifierCallback);
{% endtab %}
{% tab title="iOS" %}
Retrieves the Analytics tracking identifier.
+ (void) getTrackingIdentifier: (nonnull void (^) (NSString* __nullable trackingIdentifier)) callback;
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier) {
// use returned trackingIdentifier
}];
Swift
ACPAnalytics.getTrackingIdentifier { (trackingIdentifier) in
// use returned trackingIdentifier
}
{% endtab %}
{% tab title="React Native" %}
Retrieves the Analytics tracking identifier.
ACPAnalytics.getTrackingIdentifier().then(identifier => console.log("AdobeExperienceSDK: Tracking identifier: " + identifier));
{% endtab %} {% endtabs %}
{% hint style="warning" %} Please review Adobe Analytics's Visitor ID Order documentation before using this API. {% endhint %}
Sets a custom Analytics visitor identifier. Please see Custom Visitor ID for more information.
{% tabs %} {% tab title="Android" %}
public static void setVistorIdentifier(final String visitorIdentifier)
Analytics.setVistorIdentifier("custom_identifier");
{% endtab %}
{% tab title="iOS" %}
+ (void) setVistorIdentifier: (nonnull NSString*) visitorIdentifier;
Here are examples in Objective-C and Swift:
Objective-C
[ACPAnalytics setVistorIdentifier:@"custom_identifier"];
Swift
ACPAnalytics.setVistorIdentifier("custom_identifier")
{% endtab %}
{% tab title="React Native" %}
ACPAnalytics.setVisitorIdentifier("yourVisitorId");
{% endtab %} {% endtabs %}
{% hint style="warning" %} Please review Adobe Analytics's Visitor ID Order documentation before using this API. {% endhint %}
Sets a custom Analytics visitor identifier. Please see Custom Visitor ID for more information.
{% tabs %} {% tab title="Android" %}
public static void getVisitorIdentifier(AdobeCallback<String> callback)
{% endtab %}
{% tab title="iOS" %}
+ (void) getVisitorIdentifier: (nonnull void (^) (NSString* __nullable visitorIdentifier)) callback;
**** {% endtab %}
{% tab title="React Native" %}
ACPAnalytics.getVisitorIdentifier().then(vid => console.log("AdobeExperienceSDK: Visitor identifier: " + vid));
{% endtab %} {% endtabs %}