Custom Properties let you target an A/B Test using information that is specific to your visitors or customers.
For example, you could target visitors based on:
- Subscription plan
- Customer type
- Account value
- Number of purchases
- Lead score
Custom Properties are sent to Crazy Egg from your website using JavaScript. Once Crazy Egg has received a property, you can use it when configuring the audience for an A/B Test.
Before you begin
Before setting up Custom Property targeting:
- Make sure the Crazy Egg tracking script is installed on your site.
- Custom Property targeting currently supports text and number values.
- Do not send sensitive personal information, passwords, payment details, or other confidential data.
- Property names and text values are case-sensitive. For example, Pro and pro are treated as different values.
Pass Custom Properties to Crazy Egg
Use CE2.trackEvent() to send Custom Properties to Crazy Egg. Add the properties you want to use inside userProperties.
CE2.trackEvent({
name: 'customer_profile',
userProperties: {
plan: 'Pro',
customerType: 'Business',
lifetimeValue: 1250,
purchaseCount: 8
}
});
The name field is required and identifies the custom event.
Each item inside userProperties includes:
- A property name, such as plan
- The visitor’s current value, such as Pro
For example: plan: ‘Pro’ OR lifetimeValue: 1250
Send properties before the visitor reaches the test
Crazy Egg needs to receive the Custom Property before it evaluates whether the visitor should be included in an A/B Test.
We recommend sending the property earlier in the visitor’s journey rather than waiting until the experiment page has loaded.
For example, if an A/B Test targets visitors whose plan is Pro, send that property as soon as your site knows the visitor’s plan.
If a Custom Property does not appear
If you do not see a property when configuring your A/B Test, check the following:
- Crazy Egg has received at least one event containing the property.
- The property was sent from the same site where you are configuring the A/B Test.
- The property contains a supported text or number value.
- The property name matches exactly, including capitalization.
- The event was sent successfully after the Crazy Egg tracking script loaded.
Boolean values, arrays, and objects cannot currently be selected for A/B Test targeting.
Custom Property limits
The following limits apply:
- Up to 25 properties can be sent in a single event.
- An account can register up to 100 unique property names across its sites.
- Property names can contain up to 100 characters.
- Text values can contain up to 1,024 characters.
- Empty or invalid property objects are ignored.