Skip to content

Latest commit

 

History

History
114 lines (81 loc) · 4.3 KB

profiles-event-reference.md

File metadata and controls

114 lines (81 loc) · 4.3 KB

Profiles event reference

Events handled

The following events are handled by the Profile extension:

USER_PROFILE : REQUEST_PROFILE

The event is used to put a user profile attribute update action on the Event Hub and is consumed by the Profile extension. This event is generated when an updateUserAttribute call is made by the SDK client.

Event details

Event Type Event Source Paired Paired Event
com.adobe.eventType.userProfile com.adobe.eventSource.requestProfile No

Data payload definition

Here are the key-value pairs in this event:

Key Value Type Optional Description
userprofileupdatekey Map<String, Object> no A map of the attributes and the attribute values that the client wants to update or add to the User Profile that is managed by the Adobe Experience Platform SDK. An existing attribute name updates the attribute in the SDK, and a new attribute name adds a new attribute to the profile. When the value of an attribute is null, the attribute is deleted from the profile. Currently supported object types are String, Integer, Double, Boolean, Map and Vector. All the other types are ignored during processing.

Event data example

Here is a code sample of the USER_PROFILE : REQUEST_PROFILE event:

{
    EventName : "UserProfileUpdate"
    EventType : "com.adobe.eventType.userProfile",
    EventSource : "com.adobe.eventSource.requestProfile",
    EventData: {
            "userProfileupdatekey":
                     {
                        "userName": "JohnDoe",
                        "creditPoints": 255,
                        "isPaidUser": true
                     }
                }
}

USERPROFILE : REQUEST_RESET

This event clears the specified key from the Profile extension and is generated when the removeUserAttributes API is called.

Data payload definition

Key/Key Type Value Type Optional Description
userprofileremovekey String No The attribute key which has to be deleted

Example

Here is a code sample of the USERPROFILE : REQUEST_RESET event:

{
    EventName : "RemoveUserProfile"
    EventType : "com.adobe.eventType.userProfile",
    EventSource : "com.adobe.eventSource.requestReset",
    EventData: {
                "userprofileremovekey": "userName"
               }
}

Events dispatched

The following events are dispatched by the Profile extension:

USER_PROFILE : RESPONSE_PROFILE

The event is used to share the user profile with the other extension. This event will be generated by the Profile extension when the user profile is updated and persistently stored.

Data payload definition

Key Value Type Optional Description
userprofiledata Map<String, Object> no A map of all the user profile attributes and the attribute values. This map contains the most updated copies of all of the user profile attributes. The consumers of this data might replace the existing user profile copy that they might have with this copy.

Here is a code sample for the USER_PROFILE : RESPONSE_PROFILE event:

{
    EventName : "UserProfile Response Event"
    EventType : "com.adobe.eventType.userProfile",
    EventSource : "com.adobe.eventSource.responseProfile",
    EventData: {
          "userprofiledata":
               {
                "userName": "John Doe"
                 "creditPoints": 255,
                 "isPaidUser": true
               }
          }
}

Shared state

EXTENSION_NAME: com.adobe.module.userProfile

The shared state for the Profile extension is created in the following situations:

  • At initialization After the extension is initialized, the extension updates the shared state by reading the previously set value from persistence.
  • Each time a UserProfile attribute is created or updated The shared state is updated when there is a change in the user attribute data from the API or by other triggers (Rules Engine).
Key Value Type Optional Description
userprofiledata Map<String, Object> no Map that contains all the key-value pairs of the user profile attributes.