The identification script allows you to manually associate custom parameters to the anonymous visitors on your site. Additionally, you can use the identification script to de-anonymize visitors on your site by associating them with an email. Before diving into this article, we recommend reading the visitor identification overview here.
Installing the identification script
To install the identification script, you should call the Javascript method below right after a user has identified themselves through registering for your service, logging in to your product, or when they update/change their info.
If you're looking to install the script just for the purposes of email matching to a user in your CRM, you need to pass at minimum, an email. An example of this would be:
window.mutiny.client.identify(null, {
email: 'support@mutinyhq.com'
})
In the example below, we're identifying a bit more information, including a user's name, email, and title, as well as their unique CRM ID (a1cab...).
window.mutiny.client.identify("a1cab6eb-fe12-4ded-beb5-201e9cb575c7", {
name: 'Marc Benioff',
email: 'marc@salesforce.com',
title: 'CEO'
})
Once you call this method, you will be able to use these attributes for segmentation and personalization on subsequent page views.
User ID
The first argument to identify is a user ID. We recommend using the ID that represents that user in your own database. This way, all the data you use for personalization will match the records in your database and be kept in sync.
If you want to associate data to a user that has not yet been recognized via registration or login, you can leave this parameter blank and we will associate the information to an anonymous user.
window.mutiny.client.identify(null, {
viewedPricing: true
})
Mutiny maintains an anonymous visitor token for you to automatically keep track of these anonymous properties.
When a user first lands on your website, we will associate page views and conversion events to this anonymous user to understand what they did before signing up. Once a user signs up, we will merge all of their anonymous properties with their known user properties, providing the full picture of what a user has done.
If a user first visits from their computer and then from their mobile device, this would normally be 2 separate anonymous visitors. However, once they login, we will know that these two anonymous visitors are actually a single user, and we will merge these profiles together.
Company Properties
While we can collect metadata about users, it is also helpful to use information about the company the user works for to personalize.
Data passed to us about a company will be consolidated and shared for all users that work at that company. You can pass us company information about a user through the identify method.
window.mutiny.client.identify('a1cab6eb-fe12-4ded-beb5-201e9cb575c7', {
email: 'brian@airbnb.com',
name: 'Brian Chesky',
title: 'CEO',
company: {
id: 'b4c64565-adc1-4ba1-9a0f-d9639615e68c',
domain: 'airbnb.com',
name: 'AirBnb',
industry: 'Information Technology',
employeeCount: 6100,
plan: 'premium'
}
})
Mutiny will take all the attributes in the company key and associate them with a separate Account object that will be shared across all of your users that belong to that organization. We will merge in all attributes we see in subsequent identify calls under the company key to this account.
Reserved Properties
There are a few reserved user properties that have special meanings in Mutiny. This allows us to have explicit handling of these attributes to enable data enrichment and other personalization features. You should only use these properties for their intended meaning.
Additionally, there are reserved company properties that should only be used for their intended meaning.
Comments
0 comments
Please sign in to leave a comment.