GitHub project

Identify profiles

Updated August 17, 2026

Use CustomerIO.identify() to identify a profile. You need to identify a mobile user before you can send them messages or track events for things they do in your app.

This page is part of a setup flow for the SDK. Before you continue, make sure you've implemented previous features—i.e. you can't identify people before you initialize the SDK!

graph LR getting-started(Install SDK) -->B(Initialize SDK) B --> identify(identify people) identify -.-> track-events(Send events) identify -.-> push(Receive push) identify -.-> rich-push(Receive Rich Push) track-events --> test-support(Write tests) push --> test-support rich-push --> test-support identify -.-> in-app(Receive in-app) in-app --> test-support click getting-started href "/integrations/sdk//getting-started/#install" click B href "/integrations/sdk//getting-started/#initialize-the-sdk" click identify href "/integrations/sdk//identify" click track-events href "/integrations/sdk//track-events/" click push href "/integrations/sdk//push" click rich-push href "/integrations/sdk//rich-push" click in-app href "/integrations/sdk//in-app" click test-support href "/integrations/sdk//test-support" style identify fill:#B5FFEF,stroke:#007069

Identify a profile

Identifying a person:

  1. Adds or updates the person in your workspace. This is basically the same as an identify call to our server-side API.
  2. Saves the person's information on the device. Future calls to the SDK reference the identified person. For example, after you identify a person, any events that you track are automatically associated with that person.
  3. Associates the current device token with the person.

You can only identify one customer at a time. The SDK "remembers" the most recently-identified customer. If you identify person A, and then call the identify function for person B, the SDK "forgets" person A and assumes that person B is the current app user. You can also stop identifying a person, which you might do when someone logs off or stops using your app for a significant period of time.

An identify request takes two parameters:

  • identifier (required): The unique value representing a profile—an ID, email address, or the cio_id.
  • attributes (Optional): An object containing attributes that you want to add to, or update on, a profile.
import 'package:customer_io/customer_io.dart';

// Call this method whenever you are ready to identify a user
CustomerIO.identify(identifier: "person@example.com", attributes: {"first_name": "Dana"});

Update a profile’s attributes

You store information about a profile in Customer.io as attributes. When you call the CustomerIO.identify() function, you can update a profile’s attributes on the server-side.

You can update a profile’s attributes after you identify them using setProfileAttributes—like when a person updates their preferences or provides additional information about themselves that you want to store in Customer.io.

You only need to pass the attributes that you want to create or modify to setProfileAttributes. For example, if you identify a new profile with the attribute {"first_name": "Dana"}, and then you call CustomerIO.setProfileAttributes(attributes: {"favorite_food": "pizza"}); after that, the profile’s first_name attribute will still be Dana.

const profileAttributes = {
      "favouriteFood": "Pizza",
      "favouriteDrink": "Mango Shake",
    };
CustomerIO.setProfileAttributes(attributes: profileAttributes);

Device attributes

When you register a device token to a profile, we automatically collect device attributes. You can use these attributes in segments and other automation workflow conditions to target the device owner, just like you would use a profile’s other attributes. You cannot, however, use device attributes to personalize messages with liquid yet.

For each device, we automatically collect the device platform attribute. Within your workspace, we also automatically set a last_used timestamp indicating when the device owner was last identified, and the last_status of a push notification you sent to the device. By default, we also automatically capture a series of attributes, like the device’s operating system, model, push_enabled preference. You can add custom attributes to the attributes object.

  • idstringrequired
    The device token.
  • last_usedinteger(unix timestamp)
    The timestamp when you last identified this device. If you don't pass a timestamp when you add or update a device, we use the time of the request itself. Our SDKs identify a device when a person launches their app.
  • platformstringrequired
    The device/messaging platform.
    Accepted values: ios, android
  • attributesobject
    Attributes that you can reference to segment your audience—like a person's attributes, but specific to a device. These can be either the attributes defined below or custom key-value attributes.
    • device_osstring
      The operating system, including the version, on the device.
    • device_modelstring
      The model of the device a person uses.
    • app_versionstring
      The version of your app that a customer uses. You might target app versions to let people know when they need to update, or expose them to new features when they do.
    • cio_sdk_versionstring
      The version of the Customer.io SDK in the app.
    • _last_statusstring
      The delivery status of the last message sent to the device—sent, bounced, or suppressed. An empty string indicates that that the device hasn't received a push yet.
      Accepted values: , bounced, sent, suppressed
    • device_localestring
      The device's IETF language code, such as en-MX or es-ES.
    • push_enabledstring
      If "true", the device is opted-in and can receive push notifications.
      Accepted values: true, false
    • Custom Device Attributes *string
      Custom properties that you want to associate with the device.

Set custom device attributes

You can also set custom device attributes with the setDeviceAttributes method. You might do this to save app preferences, time zone, or other custom values specific to the device. Like profile attributes, you can pass nested JSON to device attributes.

However, before you set custom device attributes, consider whether the attribute is specific to the device or if it applies to the profile more broadly. Device tokens are ephemeral—they can change based on user behavior, like when a person uninstalls and reinstalls your app. If you want an attribute to persist beyond the life of the device, you should apply it to the profile rather than the device.

const deviceAttributes = {
      "type" : "primary_device",
      "parentObject" : {
        "childProperty" : "someValue",
      },
    };
CustomerIO.setDeviceAttributes(attributes: deviceAttributes);

Manually add device to profile

In the standard flow, identifying a profile automatically associates the token with the identified profile in your workspace. If you need to manually add or update the device elsewhere in your code, call the method CustomerIO.registerDeviceToken(token).

const registerDevice = () => {
     // Customer.io expects a valid token to send push notifications
     // to the user.
     const token = 'token'

     CustomerIO.registerDeviceToken(token)
 }

Stop identifying a profile

When a person logs out, or does something else to tell you that they no longer want to be tracked, you should stop identifying them.

Use clearIdentify() to stop identifying the previously identified profile (if there was one).

CustomerIO.clearIdentify();

Identify a different profile

If you want to identify a new profile—like when someone switches profiles on a streaming app, etc—you can simply call identify() for the new profile. The new profile then becomes the currently-identified profile, with whom all new information—messages, events, etc—is associated.

CustomerIO.identify(identifier: "new.person@example.com", attributes: {"first_name": "New", "last_name": "Person"});