Fanplayr 360
  • Introduction
  • Data
  • Navigation
  • Tutorials
    • Sync High Value Users to Facebook Custom Audience
  • Features
    • Overview
    • Filters
      • Examples
    • Insights
    • Audiences
      • List
      • Editing
    • Automations
      • List
      • Editing
    • Pipelines
      • List
      • Editing
    • Exports
      • List
      • Editing
    • Profiles
      • Profile
  • 🔗Integrations
    • Sources
      • List
      • Editing
    • Destinations
      • List
      • Editing
    • Catalog
      • Amplitude
      • Attentive
      • AWS S3
      • Cordial
      • Custom Integration
      • Facebook Custom Audience
      • FTP/SFTP - Password Authentication
      • Google Ads
      • JavaScript
      • Mailchimp
      • Mailup
      • Pipedrive
      • Salesforce Commerce Cloud
      • Salesforce Marketing Cloud
      • Send In Blue
      • SFTP - SSH Key Authentication
      • Shopify
      • Slack
      • TikTok
      • Twilio
      • VTEX IO
  • Other
    • Mapping
      • Events
      • Event Attributes
    • Data Dictionary
      • Events
      • Event Attributes
      • User Attributes
    • Data Health
    • Compliance
      • PII
      • Consent
    • Account Settings
      • Personal
      • Preferences
      • Company
      • Users
      • Security
      • Invoices
  • 👩‍💻API Reference
    • API Overview
    • JavaScript API
      • Javascript API Reference
    • Custom API
      • Sessions and Users
      • Tracking Page Views
      • Tracking Events
      • Managing Identity
      • User Profile Data
      • Managing Consent
    • Semantic Data
      • Semantic Events
        • E-Commerce
        • Messaging
        • Other
      • Semantic Objects
      • Semantic User Attributes
      • Fanplayr 360 Generated Attributes
  • PrivacyID
  • Appendix
    • Terminology
Powered by GitBook
On this page
  • Operations
  • Expiry
  • Set
  • Set Once
  • Unset
  • Increment
  1. API Reference
  2. Custom API

User Profile Data

PreviousManaging IdentityNextManaging Consent

Last updated 1 year ago

Data can be stored on a user that can then be used throughout the system. These attributes can include .

Operations on user Profile data use the message type userDataOps.

Operations

The operations parameter takes an . These can be of the following type:

  • set - sets a Profile attribute to a given value

  • setOnce - sets a Profile attribute to a given value if it currently does not exist

  • unset - removes a Profile attribute

  • increment - increments a Profile attribute by a given integer amount

You can send as many operations as needed at a time, and they can be of more than one type.

Expiry

Both set and setOnce allow you to supply an expiresOn property. This must be an integer of UTC; in milliseconds.

Set

Use this to set an attribute on a Profile.

Example

This example sets the attribute favoriteColor to red. This Profile property will expire near the beginning of 2024.

{
  "type": "userDataOps",
  // the operations
  "operations": [{
    "type": "set",
    "key": "favoriteColor",
    "value": "red",
    "expiresOn": 1704139200000
  }],
  // general message properties
  "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"
  "context": {
    "page": {
      "url": "https://www.weather-station.com/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Get Weather"
    },
  }
}

Set Once

Use this to set an attribute on a Profile only if it has not yet been set..

Example

This example, if run after the set example, will not change the Profile attribute as the value has already been set.

{
  "type": "userDataOps",
  // the operations
  "operations": [{
    "type": "setOnce",
    "key": "favoriteColor",
    "value": "green"
  }],
  // general message properties
  "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"
  "context": {
    "page": {
      "url": "https://www.weather-station.com/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Get Weather"
    },
  }
}

Unset

Use this to remove an attribute from a Profile.

Example

This example removed the attribute favoriteColor.

{
  "type": "userDataOps",
  // the operations
  "operations": [{
    "type": "unset",
    "key": "favoriteColor"
  }],
  // general message properties
  "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"
  "context": {
    "page": {
      "url": "https://www.weather-station.com/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Get Weather"
    },
  }
}

Increment

Use this to increment a value on a Profile attribute.

If an attribute with the name already exists, and it is not an integer, the value will also be set to 1. This is true even if the value is a string of "1" rather than the actual value of 1. Also float values such as 10.5 will be reset to 1 on the first increment call.

Example

This example will increment the attribute numberOfLoginAttempts by 1.

{
  "type": "userDataOps",
  // the operations
  "operations": [{
    "type": "increment",
    "key": "numberOfLoginAttempts",
    "value": 1
  }],
  // general message properties
  "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"
  "context": {
    "page": {
      "url": "https://www.weather-station.com/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Get Weather"
    },
  }
}
👩‍💻
Profile
Semantic User Attributes
epoch time
array of operations