Identify Users

Calling the identify function creates or updates a profile in People. 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 email address is needed to identify somebody.

Note: You can alternatively track a user with an ID field as a unique identifier, opposed to an email address. However, this may increase the chances of creating duplicate profiles with the same email address. This is especially prevalent when connecting any of our integrations which will either find or create a profile using an email address as a unique identifier.

The email 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
email (required)The email address and unique identifier of this user.Stringemail@example.com
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.Stringhttps://profile-img.com/simon.png
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
id (required if no email property)An alternate option for the unique identifier of this user.String253552
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" }

Usage

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

Your user's email address will act as their unique identifier, you can pass that to the email field.

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

  custom: {
    any: 'custom',
    properties: 'here',
    // other custom properties...
  }
});

Unidentify

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.

_gs('unidentify');