Audience Manager API reference

Send signals to Audience Manager

Use this method to send a signal with traits to Audience Manager and get the matching segments returned in a block callback. Audience manager sends the UUID in response to an initial signal call. The UUID is persisted on local SDK storage and is sent by the SDK to Audience Manager in all subsequent signal requests.

If you are using the Experience Cloud ID (ECID) Service (formerly MCID), the ECID and other custom identifiers for the same visitor are sent with each signal request. The visitor profile that is returned by Audience Manager is saved in SDK local storage and is updated with subsequent signal calls.

For more information about the UUID and other Audience Manager identifiers, see Index of IDs in Audience Manager.

Android
iOS
React Native

signalWithData

In Android, the UUID is persisted in SharedPreferences.

Syntax

public static void signalWithData(final Map<String, String> data, final AdobeCallback<Map<String, String>> callback)

Example

AdobeCallback<Map<String, String>> visitorProfileCallback = new AdobeCallback<Map<String, String>>() {
@Override
public void call(final Map<String, String> visitorProfile) {
// your own customized code
}
};
Map<String, String> traits = new HashMap<String, String>();
traits.put("trait", "xyz");
Audience.signalWithData(traits, visitorProfileCallback);

signalWithData

On iOS, UUID is persisted in NSUserDefaults.

Syntax

+ (void) signalWithData: (NSDictionary<NSString*, NSString*>* __nullable) data
callback: (nullable void (^) (NSDictionary* __nullable visitorProfile)) callback;

Examples

Objective-C

NSDictionary *traits = @{@"key1":@"value1",@"key2":@"value2"};
[ACPAudience signalWithData:traits callback:^(NSDictionary* visitorProfile){
// your customized code
}];

Swift

ACPAudience.signal(withData: ["key1": "value1", "key2": "value2"], callback: {(_ response: [AnyHashable: Any]?) -> Void in
// your customized code
})

JavaScript

signalWithData

ACPAudience.signalWithData({"yourDataKey": "yourDataValue"}).then(profile => console.log("AdobeExperienceSDK: Visitor Profile: " + profile));

Reset identifiers and profiles

This API helps you reset the Audience Manager UUID and purges the current visitor profile.

For more information about the UUID, the DPID, the DPUUID and other Audience Manager identifiers, see Index of IDs in Audience Manager.

Android
iOS
React Native

reset

Syntax

public static void reset()

Example

Audience.reset();

reset

Syntax

+ (void) reset;

Examples

Objective-C

[ACPAudience reset];

Swift

ACPAudience.reset()

JavaScript

reset

ACPAudience.reset();

Get the visitor profile

Returns the visitor profile that was most recently updated. The visitor profile is saved in the SDK's local storage for access across multiple launches of your app. If no audience signal has been sent before, when this API is called, a null value is returned.

Android
iOS
React Native

getVisitorProfile

In Android, the visitor profile is saved in SharedPreferences.

Syntax

public static void getVisitorProfile(final AdobeCallback<Map<String, String>> adobeCallback)

Example

AdobeCallback<Map<String, String>> visitorProfileCallback = new AdobeCallback<Map<String, String>>() {
@Override
public void call(final Map<String, String> visitorProfile) {
// your own customized code
}
};
Audience.getVisitorProfile(visitorProfileCallback);

getVisitorProfile

On iOS, the visitor profile is saved in NSUserDefaults.

Syntax

+ (void) getVisitorProfile: (nonnull void (^) (NSDictionary* __nullable visitorProfile)) callback;

Example

Objective-C

[ACPAudience getVisitorProfile:^(NSDictionary* visitorProfile){
// your customized code
}];

Swift

ACPAudience.getVisitorProfile({(_ response: [AnyHashable: Any]?) -> Void in
// your customized code
})

JavaScript

getVisitorProfile

ACPAudience.getVisitorProfile().then(profile => console.log("AdobeExperienceSDK: Visitor Profile: " + profile));