-
public final class Batch.ProfileBatch Profile module
-
-
Method Summary
Modifier and Type Method Description static voididentify(@Nullable() String identifier)Identify the user's installation with an omnichannel profile. static BatchProfileAttributeEditoreditor()Get a profile attribute editor. static voidtrackEvent(@NonNull() String event)Track an event.You can call this method from any thread. static voidtrackEvent(@NonNull() String event, @Nullable() BatchEventAttributes attributes)Track an event.You can call this method from any thread. static voidtrackLocation(@NonNull() Location location)Track a location update.You can call this method from any thread. -
-
Method Detail
-
identify
static void identify(@Nullable() String identifier)
Identify the user's installation with an omnichannel profile.
- Parameters:
identifier- the custom user identifier or null to erase
-
editor
@NonNull() static BatchProfileAttributeEditor editor()
Get a profile attribute editor.
Batch must be started to save it.Note that you should chain calls to the returned editor.If you call this method again, you will get another editor that's not aware of changes made elsewhere that have not been saved.
-
trackEvent
static void trackEvent(@NonNull() String event)
Track an event.You can call this method from any thread. Batch must be started at some point, or events won't be sent to the server.
- Parameters:
event- The event name.
-
trackEvent
static void trackEvent(@NonNull() String event, @Nullable() BatchEventAttributes attributes)
Track an event.You can call this method from any thread. Batch must be started at some point, or events won't be sent to the server.
- Parameters:
event- The event name.attributes- The event attributes.
-
trackLocation
static void trackLocation(@NonNull() Location location)
Track a location update.You can call this method from any thread. Batch must be started at some point, or location updates won't be sent to the server.The location object usually comes from the location system service, or the Fused Location API, but can also manually create it.If you manually create it, please make sure to fill the accuracy and date if you have that data: both of these values are usedto improve the targeting.
- Parameters:
location- The location.
-
-
-
-