Managing Identity

Identities are used to merge user Profiles in to a unified view, across sessions in a browser, and across devices and platforms.

If a user views your website, and logs into your site, you may send an identify message letting Fanplayr 360 know that this user should be identified by a specific email, and userId.

When this same user logs into your phone app, you can make another identify call with the email address and events and profile information from both devices and sessions will be linked.

Identify Message

The identify message has two parts:

  • The type must be set to "identify"

  • The identities object must be provided. This is an object containing key/value pairs; the key being the type of identity ie "email", or "userId".

Identify events can be sent at any time, although we suggest

How profiles are linked

When you send an identify message, the userId and sessionId are recorded. Any events collected, or user profile data set, with the same userId or sessionId is merged into the same Profile.

It is important to only use identify when you are sure of having the correct identifying information, otherwise you may end up linking profiles that are not related, and there is no way of unlinking these later.

Example

The following example identifies the current session / user by both email and webPush identities.

{
  "type": "identify",
  "identities": {
    "email": "dean_martin@email.com",
    "webPush": "https://fcm.googleapis.com/fcm/send/coZZH73CpTQ:APA91bFctF2JiYJz_Bf5QBlrAmVc2T5xcIFlegj8a8rIklNtZ9bEWUsadsdl_Xd9s3nps_lwhBBIXHGeYE5pJwJTkswrbx9o5e9Wk_hBElR5oBhw33ST84Zn0tlvqMaWKMy5TWaCtgWZ"
  },
  // general event data
  "writeKey": "<WRITE_KEY>",
  "messageId": "213d7f53-ffac-4a58-a20b-5d609455d64c",
  "timestamp": "2022-11-15T04:31:44Z",
  "userId": "5.wBOQ7hKNVgIUcJn5IbX.1670273082",
  "sessionId": "28eef5c8-1098-4f76-abe9-58a921cabfaf",
  "pageId": "eca34e0f-4802-4fa4-8db1-11c727839dbd"
}

If you use email or phone as the identifier then these will be automatically added as semantic user attributes $email and $phone. Additionally, the email and phone identifiers will be automatically mapped to the keys: $email and $phone.

Last updated