For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set Custom Visitor Properties with the Pageview API

Send custom visitor properties to Crobox through the pageview API for targeting, analytics, and advanced personalization.

Use custom visitor properties in the Pageview API to send visitor-specific attributes to Crobox.

This supports targeting, analytics, and advanced personalization use cases.

window.crobox = window.crobox || [];

crobox.push(function(crobox) {
  // The Crobox API is now initialized and methods are available
  crobox.pageview({
    pt: crobox.PAGE_INDEX,
    lc: "en-GB",
    // The cp field lets you send custom visitor properties
    cp: {
      vip: true
    }
  });
});

Configuring Custom Properties in the Crobox App

After implementing the code above, complete the setup in the Crobox app:

  1. Go to Settings > Visitor Properties.

  2. Click Create New Property.

  3. Name the property using the same key you send in your pageview() call, for example vip.

  4. Set the property type to match the value you send, for example boolean for true or false.

Using Custom Visitor Properties in Crobox

After setup, you can use custom visitor properties in three main ways:

  • Targeting visitors: Segment and personalize experiences based on business-specific attributes. For example, show a specific campaign only to visitors where vip = true.

  • Filtering in analytics: Filter reports and dashboards using these properties to analyze behavior by visitor segment.

  • Supporting custom enterprise use cases: Enterprise customers can also use custom visitor properties for advanced mappings. For example, if a pageview event identifies a visitor as vip, Crobox can map that value to VIP pricing in a Product Finder or other Crobox experiences.

Contact your Account Manager if you need help defining properties or setting up custom mappings.

FAQ

What happens if I send a custom property in pageview() but don’t define it in the Crobox Admin interface?

The property will not be recognized or usable for targeting or analytics. To activate a custom property, you must create a matching Visitor Property in the Crobox panel under Settings > Visitor Properties, using the exact same key and specifying the correct value type (e.g. string, boolean, number).

Can I update a visitor’s custom property value after the first pageview?

Yes. The value of a custom visitor property can be overwritten by subsequent pageview() calls. The latest value sent for that property will be associated with the visitor moving forward.

How do custom visitor properties differ from Crobox’s built-in targeting criteria (e.g. location, device, language)?

Built-in properties are automatically collected by Crobox and require no setup, while custom visitor properties are manually defined and implemented via the cp field in the pageview() API. They enable you to extend targeting to business-specific attributes (e.g. subscription level, gender preference, login status) that Crobox wouldn’t otherwise know.

Can custom visitor properties be used in other Crobox experiences?

Yes. Standard use cases include targeting and analytics. Enterprise setups can also support custom mappings for Product Finders and other Crobox experiences. For example, a vip value sent in pageview() can be used to support VIP pricing logic or other segment-specific experiences.

Last updated

Was this helpful?