Javascript API: Attributes & Objects
Skip to content

Javascript API: Attributes & Objects

This page details the possible attributes that can be used when Installing the Messenger

window.intercomSettings = { 
  app_id: YOUR_WORKSPACE_ID
  // customise installation with your attributes 
}

Messenger Attributes

These attributes will modify the behaviour of the messenger. They do not modify user/lead data.

* The color string can be any valid CSS Color Name HEX or RGB

Data Attributes

These attributes are used to update user/lead information.

  • When user_id / email is provided, it will be saved as a User record
  • When no user_id / email is provided, it will be considered a Visitor record which is not seen in the Intercom dashboard. When a Visitor sends a message via the Intercom messenger they will be converted to a Lead which is viewable in the Intercom dashboard
  • Any other attribute not listed below and not in the Messenger Attributes will be treated as a custom user attribute
  • If the value of a custom user attribute is set to an empty string, or a string with the value "undefined", or "null", this will appear as Unknown in Platform.
  • If a value is set for a custom user attribute that has been configured to prevent updates via the Messenger then this value will be ignored in the request.
AttributeTypeDescription
emailstringThe email address of the currently logged in user (Only applicable to users)
user_idstringThe user_id address of the currently logged in user (Only applicable to users)
created_attimestampThe Unix timestamp (in seconds) when the user signed up to your workspace (Only applicable to users)
namestringName of the current user/lead
phonestringPhone number of the current user/lead
last_request_attimestampThis value can't actually be set by the Javascript API (it automatically uses the time of the last request but is a this is a reserved attribute)
unsubscribed_from_emailsbooleanSets the [unsubscribe status]((https://docs.intercom.com/faqs-and-troubleshooting/unsubscribing-users/how-do-i-unsubscribe-users-from-receiving-emails) of the record
language_overridestringSet the messenger language programmatically (instead of relying on browser language settings)
utm_campaignstringUTM Campaign valueNote: All UTM parameters are updated automatically and can not be manually overidden
utm_contentstringUTM Content value
utm_mediumstringUTM Medium value
utm_sourcestringUTM Source value
utm_termstringUTM Term value
avataravatar objectSet the avatar/profile image associated to the current record (typically gathered via social profiles via email address)
user_hashstringUsed for identity verification (Only applicable to users)
companycompany objectCurrent user's company (Only applicable to users) For field definitions see Company Object in the section below

Important: Company ID and company name are the minimum requirements to pass a company into Intercom.

Note: If users are associated with multiple companies and you want your company targeted messages to be delivered based on a specific company, make sure to include those specific company details here. Intercom will ensure that any company-based rules for your outbound messages must match that company.
companiesarray of company objectsAn array of companies the user is associated to (Only applicable to users)
page_titlestringUsed for keeping track of user page views. Default value is the document title property.

User Profile in Web Interface indicating corresponding attributes

Avatar Object

Similar to the API avatar object

window.intercomSettings =  {
  app_id: YOUR_WORKSPACE_ID, 
  user_id: USER_ID_OF_CURRENTLY_LOGGED_IN_USER, 
  avatar: {
    "type": "avatar", 
    "image_url" :"https://yourwebsite.com/user_id/profile.png"
  }
 }

Attribute in Javascript code

Attribute in API

Attribute / Data in Web interface

Type

Description

type

type

stringThe value is "avatar"
image_urlimage_urlThe avatar/profile picture of the recordstringAn avatar image URL. Note: needs to be https.

Company Object

Learn more about companies from our Help Center article.
These are very similar to the API company object.
Attributes not listed below will be considered as a custom company attribute.
Note: Company ID and company name are the minimum requirements to pass a company into Intercom.

window.intercomSettings = {
  app_id: YOUR_WORKSPACE_ID, 
  user_id: USER_ID_OF_CURRENTLY_LOGGED_IN_USER, 
  company: {
    company_id: "6",
    created_at: 1394531169,
    name: "Example Company Inc.",
    monthly_spend: 49,
    plan: "Pro",
    size: 85,
    website: "http://example.com",
    industry: "Technology"
  }
}

Company Profile in Web Interface indicating corresponding attributes