Javascript API: Attributes & Objects

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

window.intercomSettings = { 
  app_id: YOUR_APP_ID
  // cutomise installation with your attributes 
}
window.intercomSettings = { 
  app_id: YOUR_APP_ID,
  email: EMAIL_OF_CURRENTLY_LOGGED_IN_USER
  // cutomise installation with your attributes 
}

Messenger Attributes

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

Attribute in Javascript code
Type
Description

app_id

string

The app_id of your Intercom app which will indicate where to store any data

custom_launcher_selector

string

The CSS selector of an element to trigger Intercom("show") in order to activate the messenger (See docs). To target an element by ID: "#id_of_element". To target elements by class ".classname_of_elements"

alignment

string

Dictate the alignment of the default launcher icon to be on the left/right. Possible values: "left" or "right" (any other value is treated as right). (See docs)

vertical_padding

integer

Move the default launcher icon vertically. Padding from bottom of screen. Minimum value: 20. Does not work on mobile. (See docs)

horizontal_padding

integer

Move the default launcher icon horizontally. Padding from right side of screen Minimum value: 20. Does not work on mobile. (See docs)

hide_default_launcher

boolean

Hide the default launcher icon. Setting to false will forcefully show the launcher icon (See docs)

session_duration

integer

Time in milliseconds for the Intercom session to be considered active.

A value of 5 * 60 * 1000 would set the expiry time to be 5 minutes

action_color

string*

Used in button links and more to highlight and emphasise

background_color

string*

Used behind your team profile and other attributes

* 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
Attribute
Type
Description

email

string

The email address of the currently logged in user

(Only applicable to users)

user_id

string

The user_id address of the currently logged in user

(Only applicable to users)

created_at

timestamp

The Unix timestamp (in seconds) when the user signed up to your app

(Only applicable to users)

name

string

Name of the current user/lead

phone

string

Phone number of the current user/lead

last_request_at

timestamp

This 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_emails

boolean

Sets the unsubscribe status of the record

language_override

string

Set the messenger language programmatically (instead of relying on browser language settings)

utm_campaign

string

utm_content

string

utm_medium

string

utm_source

string

utm_term

string

avatar

avatar object

Set the avatar/profile image associated to the current record (typically gathered via social profiles via email address)

user_hash

string

Used for identity verification

(Only applicable to users)

company

company object

Current user's company

(Only applicable to users)

For field definitions see Company Object in the section below

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

companies

array of company objects

An array of companies the user is associated to

(Only applicable to users)

User Profile in Web Interface indicating corresponding attributes

Mapping of Javascript Attributes to Intercom Dashboard and API

Javascript
Intercom Dashboard
API

email

Email

email

user_id

User ID

user_id

created_at

Signed Up

signed_up_at

(previously remote_created_at)

name

Name

name

phone

Phone

phone

last_request_at

Last seen

last_request_at

unsubscribed_from_emails

Unsubscribed from emails

unsubscribed_from_emails

language_override

Language Override

-

utm_campaign

UTM Campaign

utm_campaign

utm_content

UTM Content

utm_content

utm_medium

UTM Medium

utm_medium

utm_source

UTM Source

utm_source

utm_term

UTM Term

utm_term

avatar

Avatar next to the name

avatar

user_hash

-

-

company

List of companies

company

companies

List of Companies

companies

Avatar Object

Similar to the API avatar object

window.intercomSettings =  {
  app_id: YOUR_APP_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

-

string

The value is "avatar"

image_url

image_url

The avatar/profile picture of the record

string

An 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_APP_ID, 
  user_id: USER_ID_OF_CURRENTLY_LOGGED_IN_USER, 
  company: {
    company_id: "6",
    created_at: 1394531169,
    name: "Blue Sun",
    monthly_spend: 49,
    plan: "Pro",
    size: 85,
    website: "http://example.com",
    industry: "Manufacturing"
  }
}
Attribute in Javascript code
Attribute in API
Attribute / Data in Web interface
Type
Description

id / company_id

company_id

Company ID

string

The company ID of the company

name

name

Name

string

The name of the company

created_at / remote_created_at

remote_created_at

Company created at

timestamp

The time the company was created in your system

plan

plan

Plan

string

The name of the plan the company is on

monthly_spend

monthly_spend

Monthly spend

number

How much revenue the company generates for your business

user_count

people

People

integer

Indicates the number of users in Intercom associated to the company

Does not actually update the value but is a reserved keyword

size

size

Company Size

integer

The number of employees in the company

website

website

Company Website

string

The URL for the company website

industry

industry

Company Industry

string

The industry of the company

Company Profile in Web Interface indicating corresponding attributes

Javascript API: Attributes & Objects


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.