Skip to content

User Update

The User Update component allows you to update a user’s attributes, events, and purchases in a JSON composer, so there’s no need to include sensitive information like API keys.

With User Update, updates don’t count toward your users.Track per minute rate limit. Instead, these updates are batched so Braze can process them more efficiently than a Braze-to-Braze webhook. Note that this component doesn’t consume data points when being used to update non-billable data points (such as subscription groups).

Users will only advance to the next Canvas steps after the relevant user updates have been completed. If your subsequent messaging relies on the user updates that you’re making, you can ensure that these updates have been completed prior to when the messages send.

Creating a user update

Drag and drop the component from the sidebar, or click the plus button at the bottom of the variant or step and select User Update.

There are three options that allow you to update existing, add new, or remove user profile information. All combined, the User Update steps in a workspace can update up to 200,000 user profiles per minute.

Updating custom attributes

To add or update a custom attribute, select an attribute name from your list of attributes and enter the key value.

Removing custom attributes

To remove a custom attribute, select an attribute name using the dropdown. You can switch to the advanced JSON composer to further edit.

Increasing and decreasing values

The user update step can increase or decrease an attribute value. Select the attribute, select Increment By or Decrement By, and enter a number.

Example: Track weekly progress

By incrementing a custom attribute that tracks an event, you can track the number of classes that a user has taken in a week. Using this component, the class count can reset at the start of the week and begin tracking again.

Updating an array of objects

An array of objects is a custom attribute stored on a user’s profile that is data rich. This allows you to create a history of the user’s interactions with your brand. This allows you to create segments based on a custom attribute that is calculated field, such as purchase history or total lifetime value.

The User Update step can add or remove attributes to this array of objects. To update an array, select the array attribute name from your list of attributes and enter the key value.

Example: Updating a user’s wishlist

Adding or removing an item to an array updates the user’s wishlist.

Example: Calculating the shopping cart total

Track when a user has items in their shopping cart, when they add new items or remove items, and what the total shopping cart value is.

  1. Create custom array of objects called shopping_cart. The following example shows what this attribute may look like. Each item has a unique product_id that has more complex data in its own nested array of objects, including price.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "attributes": [
    {
      "shopping_cart": [
       {
         "total_cart_value": number,
         "shipping": number,
         "items_in_cart": number,
         "product_id": array,
         "gift": boolean,
         "discount_code": "enum",
         "timestamp": {"$time" : "{{$isoTimestamp}}"},
       }
      ]
    }
  ]
}
  1. Create a custom event named add_item_to_cart that is logged when a user adds an item to the basket.
  2. Create a Canvas with a target audience of users with this custom event. Now, when a user adds an item to their cart, this Canvas is triggered. You can then target messaging directly to that user, offering coupon codes once they’ve reached a certain spend, abandoned their cart for a certain amount of time, or anything else that aligns with your use case.

The shopping_cart attribute carries the total of many custom events: the total cost of all the items, the total number of items in the cart, if the shopping cart contains a gift, and so on. This can look something like the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "attributes": [
    {
      "shopping_cart": [
       {
         "total_cart_value": 22.99,
         "shipping": 4.99,
         "items_in_cart": 2,
         "product_id": ["1001", "1002"]
         "gift": yes,
         "discount_code": "flashsale1000",
         "timestamp": {"$time" : "{{$isoTimestamp}}"},
       }
      ]
    }
  ]
}

Setting Canvas entry property as an attribute

You can use the user update step to persist a canvas_entry_property. Let’s say you have an event that triggers when an item is added to a cart. You can store the ID of the most recent item added to cart and use that for a remarketing campaign. Use the personalization feature to retrieve a Canvas entry property and store it in an attribute.

Personalization

To store the property of the trigger event for a Canvas as an attribute, use the personalization modal to extract and store the Canvas entry property. User Update also supports the following personalization features:

Advanced JSON composer

Add an attribute, event, or purchase JSON object up to 65,536 characters to the JSON composer. A user’s global subscription and subscription group state can also be set.

Using the advanced composer, you can also preview and test that the user profile is updated with the changes with the Preview and test tab. You can either select a random user or search for a specific user. Then, after sending a test to a user, view the user profile using the generated link.

Considerations

You don’t need to include sensitive data like your API key while using the JSON composer as this is automatically provided by the platform. As such, the following fields are unneeded and should not be used in the JSON composer:

  • External user ID
  • API key
  • Braze cluster URL
  • Fields related to push token imports

Log custom events

Using the JSON composer, you can also log custom events. Note that this requires timestamp in ISO format, so assigning a time and date with Liquid at the beginning is needed. Consider this example that logs an event with a time.

1
2
3
4
5
6
7
8
9
{% assign timestamp = 'now' | date: "%Y-%m-%dT%H:%M:%SZ" %}
{
  "events": [
    {
      "name": "logged_user_event",
      "time": "{{timestamp}}"
    }
  ]
}

This next example links an event to a specific app using a custom event with optional properties and the app_id.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{% assign timestamp = 'now' | date: "%Y-%m-%dT%H:%M:%SZ" %}
{
  "events": [
    {
      "app_id": "insert_app_id",
      "name": "rented_movie",
      "time": "{{timestamp}}",
      "properties": {
        "release": {
          "studio": "FilmStudio",
          "year": "2022"
        },
        "cast": [
          {
            "name": "Actor1"
          },
          {
            "name": "Actor2"
          }
        ]
      }
    }
  ]
}

Edit subscription state

Within the JSON composer, you can also edit your user’s subscription state. For example, the following shows a user’s subscription state updated to opted_in.

1
2
3
4
5
6
7
{
  "attributes": [
    {
      "email_subscribe": "opted_in"
    }
  ]
}

Update subscription groups

You can also update subscription groups using this Canvas step. The following example shows an update to subscription groups. You can perform one or multiple subscription group updates.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "attributes": [
    {
      "subscription_groups": [
        {
          "subscription_group_id": "subscription_group_identifier_1",
          "subscription_state": "subscribed"
        },
        {
          "subscription_group_id": "subscription_group_identifier_2",
          "subscription_state": "subscribed"
        },
        {
          "subscription_group_id": "subscription_group_identifier_3",
          "subscription_state": "subscribed"
        }
      ]
    }
  ]
}
HOW HELPFUL WAS THIS PAGE?
New Stuff!