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 Name | Description | Type | Example |
---|---|---|---|
email (required) | The email address and unique identifier of this user. | String | email@example.com |
name | The full name of the user (automatically derived from first_name and last_name if this isn't set). | String | Simon Tabor |
first_name | First name, concatenated with last_name . | String | Simon |
last_name | Last name, concatenated with first_name . | String | Tabor |
username | The username for this person. | String | simontabor |
description | A short description for the user. Defaults to their Twitter bio if we can find it. | String | Simon is a developer at GoSquared |
avatar | The absolute URL of the avatar for this person. Defaults to the gravatar for email . | String | https://profile-img.com/simon.png |
phone | The phone number for this person. | String | +447901229693 |
created_at | Set 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 timestamp | String | 2016-06-07T15:44:20Z |
id (required if no email property) | An alternate option for the unique identifier of this user. | String | 253552 |
company | An object containing company details (name , size etc). | Object | { "name": "GoSquared" } |
company_name | The name of the company the user works at. | String | GoSquared |
company_size | The size of the company. | Number | 12 |
company_industry | The industry of the company. | String | Analytics |
company_position | The position of this user within the company. | String | Developer |
custom | An 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');