Identify Users

Calling the identify function creates or updates a profile in People CRM. You can pass back as many different properties about that user as you like. A cookie is also set that tracks the user's pageviews/events against their People profile.

GoSquared defines a list of common properties that are useful to track, shown in the table below.

An id or email address is needed to identify somebody. You can set both, but only one is required.

Note: tracking users by their id and email separately will create two different profiles. GoSquared will merge these two profiles together when you next identify a user with both id and email in the properties of the same identify call.

The id field in the front end JavaScript tracker is equivalent to the person_id that you would use in our HTTP tracking API.

How many different custom properties can I track?

Take some time to think about the name you give to your properties. You can name them anything you like, but it's best to use a clear, concise name.

Each GoSquared project can track up to 1000 properties. Above this limit, properties with new names will be ignored.

Property NameDescriptionTypeExample
id (required if no email property)The unique database ID for this user.String253552
email (required if no id property)The email address of this
nameThe full name of the user (automatically derived from first_name and last_name if this isn't set).StringSimon Tabor
first_nameFirst name, concatenated with last_name.StringSimon
last_nameLast name, concatenated with first_name.StringTabor
usernameThe username for this person.Stringsimontabor
descriptionA short description for the user. Defaults to their Twitter bio if we can find it.StringSimon is a developer at GoSquared
avatarThe absolute URL of the avatar for this person. Defaults to the gravatar for email.String
phoneThe phone number for this person.String+447901229693
created_atSet the date that the user first signed up for your service – ISO 8601 timestamp. When the user is being identified for the first time, this defaults to the current timestampString2016-06-07T15:44:20Z
companyAn object containing company details (name, size etc).Object{ "name": "GoSquared" }
company_nameThe name of the company the user works at.StringGoSquared
company_sizeThe size of the company.Number12
company_industryThe industry of the company.StringAnalytics
company_positionThe position of this user within the company.StringDeveloper
customAn object of any other properties (custom properties)Object{ "plan": "pro" }


Identify can be called on any page that already has the basic tracking code installed.

If you have an id for your user (most likely from your user database) then you can pass that in the id field.

Do not use the user's email address in the id field. It should instead be put in the email field, with the id field left empty.

_gs('identify', {
  id: 123456,
  name: 'User Name',
  email: '',
  // other special properties...

  custom: {
    any: 'custom',
    properties: 'here',
    // other custom properties...

Identify with an email address

Alternatively you can just pass an email address in the email field and that will be used in People CRM to identify the user.

_gs('identify', {
  email: '',
  name: 'User Name',
  // other special properties...


When a user has logged out, you may wish to remove their identity for tracking. This will prevent new data from being associated with the user.