# Setting Custom Visitor Properties with Pageview API

Here's how you can use this feature:

```javascript
crobox.push(function(crobox) {
  // The Crobox API is now initialized and methods are available
  crobox.pageview({
    pt: crobox.PAGE_INDEX,
    lc: "en-AA", 
    // The cp (custom property) field lets you send any custom visitor property
    cp: {
      cuddles: "yes"
    }
  });
});
```

### Configuring Custom Properties in the Crobox App

After implementing the above code, follow these steps to 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` (e.g. `cuddles`).
4. **Set the property type** accordingly, such as boolean if the pageview value is a yes/no function.

### Using Custom Visitor Properties in Crobox

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

* **Targeting visitors**: Use them to segment and personalize your Crobox experiences (e.g. show a specific campaign only to visitors where `cuddles = yes`).
* **Filtering in analytics**: Filter reports and analytics dashboards based on these properties to gain deeper insights.

{% hint style="info" %}
Contact your Account Manager for additional assistance.
{% endhint %}

### FAQ

<details>

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

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).

</details>

<details>

<summary>Can I update a visitor’s custom property value after the first pageview?</summary>

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.

</details>

<details>

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

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.

</details>
