Visitor ID lets you identify a visitor in Crazy Egg using an identifier supplied by your website.
This is useful when you want to distinguish particular visitors or groups of known visitors and use that information with Crazy Egg features that support Visitor ID.
An identifier might be:
- A customer ID
- An account ID
- A username
- An email address
- Another unique string your system uses to identify the visitor
How Visitor ID Works
Your website passes the visitor’s identifier to Crazy Egg using CE2.identify().
The identifier is a string:
CE2.identify(identifier);
To make sure Crazy Egg has initialized before the identifier is passed, use:
(window.CE_API || (window.CE_API = [])).push(function(){
CE2.identify(userID);
});
Replace userID with the value your website uses to identify the visitor.
For example:
(window.CE_API || (window.CE_API = [])).push(function(){
CE2.identify('customer-12345');
});
When to Identify the Visitor
Call CE2.identify() as soon as your website knows who the visitor is.
For example, you might identify a visitor:
- After they log in
- When their account information becomes available
- After your application loads an authenticated user’s details
Passing the identifier early allows Crazy Egg to associate it with the visitor before that information is needed by a supported feature.
Use Visitor ID in an Audience
When configuring a Crazy Egg feature that supports Visitor ID:
- Open the Audience settings for the feature you are configuring.
- Select Identified Visitor.
- Enter the visitor identifier or configure the matching condition you want to use.
- Finish configuring the Audience and the feature.
This lets you define an audience based on known visitors rather than relying only on page, device, location, or other conditions.
The available matching options may depend on the Crazy Egg feature and plan you are using.
Using Visitor ID with A/B Testing
Visitor ID can be used to control who is eligible to see an A/B Test.
For example, you could use Visitor ID to make a test available only to:
- A particular customer
- Visitors associated with certain account IDs
- A group of known users identified by your application
When setting up the A/B Test, continue until you reach the Audience section. Choose to target specific visitors, then select the appropriate Identified Visitor condition.
A visitor must meet both the Audience requirements and the other conditions of the A/B Test before they can see the test.
Using Visitor ID with Recordings
Visitor ID can also help you locate recordings from a particular visitor.
When an identifier has been associated with a recorded session, you can filter your Recordings to find sessions belonging to that visitor.
This can be particularly useful when investigating a reported problem.
For example, if a customer contacts your support team about an issue, you can use the identifier associated with that customer to find their relevant recordings and review what happened during their visit.
Keep in mind that an identifier can only appear on a Recording if that visitor’s session was recorded.
Using Visitor ID with Other Features
The same visitor identifier can be reused by other Crazy Egg features that support Visitor ID.
This means you can implement visitor identification once and use that information across supported features without needing a separate identification method for each one.
Privacy Considerations
Only pass visitor information that is appropriate for your organization’s privacy and data-handling requirements.
Avoid sending passwords, payment details, authentication credentials, or other sensitive confidential information.
If you do not need to use an email address or other directly recognizable value, consider using your application’s internal customer or account identifier instead.
Troubleshooting
If an identified visitor is not appearing or matching as expected, check that:
- The Crazy Egg tracking script is installed and loading correctly.
CE2.identify()runs after Crazy Egg initializes.- Your site knows the visitor’s identifier at the point where the function is called.
- The expected identifier is being passed as a string.
- The visitor is identified before the information is needed by the applicable feature.
For Recordings specifically, also confirm that the visitor’s session was actually selected for recording.
Summary
Visitor ID lets your website tell Crazy Egg who a visitor is by passing a unique identifier with CE2.identify().
Once identified, you can use that information with supported Crazy Egg features, such as filtering Recordings or defining Audiences for A/B Tests.