# Attributes

Attributes store visitor and session characteristics. Use attributes to segment visitors based on who they are and how they behave.

<figure><img src="/files/cyvIng1uptHBQ72kUEq0" alt=""><figcaption></figcaption></figure>

## What attributes do

Attributes capture data about visitors and sessions:

* Who the visitor is
* What device they use
* Where they came from
* How they behave

Unlike events (actions), attributes represent state or characteristics.

## Attribute categories

### Popular attributes

Commonly used attributes that work for most sites:

* Browser type
* Device type
* Operating system
* Traffic source
* Geographic location

### Device attributes

Characteristics of the visitor's device:

* Device type (desktop, mobile, tablet)
* Screen resolution
* Browser
* Operating system

<figure><img src="/files/uNK3683JhltMqUTHYFuP" alt=""><figcaption></figcaption></figure>

### Journey attributes

Session and visit patterns:

* Session count
* Pages viewed this session
* Time on site
* Entry page
* Referrer

<figure><img src="/files/GhOEkW2g46dUPmjwh8VQ" alt=""><figcaption></figcaption></figure>

### Visitor attributes

Personal characteristics:

* First visit date
* Last visit date
* Total sessions
* Lifetime page views
* Customer status

<figure><img src="/files/aOrHemYisfLXFf60z17K" alt=""><figcaption></figcaption></figure>

### Custom attributes

Attributes you define and pass to AdaptiveCX:

* Loyalty tier
* Account type
* Subscription status
* Any custom data

<figure><img src="/files/27s1Zee98bQI5ayd0RLU" alt=""><figcaption></figcaption></figure>

## System vs custom attributes

### System attributes

AdaptiveCX automatically collects these:

* Device info
* Geographic data
* Session patterns
* Traffic sources

You can view and use them but not modify them.

### Custom attributes

Define and send these from your system:

```javascript
adaptivecx.setAttribute('loyalty_tier', 'gold');
adaptivecx.setAttribute('account_type', 'enterprise');
```

Custom attributes let you integrate your business data into AdaptiveCX.

## Create a custom attribute**Open attributes**

Go to `Core` > `Attributes` and click **Custom Attributes**.

**Create new attribute**

Click **Create New Attribute**.

**Configure the attribute**

Provide:

* **Name** - How it appears in AdaptiveCX
* **Key** - The identifier used in code
* **Data type** - String, number, boolean, or date
* **Description** - What the attribute means

**Save the attribute**

## Send custom attributes

Pass custom attributes through the AdaptiveCX JavaScript API:

```javascript
// Set a single attribute
adaptivecx.setAttribute('loyalty_tier', 'gold');

// Set multiple attributes
adaptivecx.setAttributes({
  'loyalty_tier': 'gold',
  'account_type': 'enterprise',
  'years_as_customer': 3
});
```

Or send via server-side API for backend integrations.

## Attribute data types

Choose the right type for each attribute:

* **String** - Text values like tier names, categories
* **Number** - Numeric values like counts, scores
* **Boolean** - True/false like "is\_subscriber"
* **Date** - Date values like signup\_date

## Use attributes

### In audiences

Create segments based on attributes:

* Device = mobile
* Session count > 5
* Loyalty tier = gold
* Geographic region = Europe

### In predictions

Include attributes as prediction features:

* Returning visitors more likely to convert
* Mobile users behave differently
* Geographic location affects purchase patterns

### In adaptive experiences

Personalize based on attributes:

* Show mobile-optimized layouts
* Tailor content by customer type
* Adjust offers by loyalty tier

## View attribute values

For each attribute, view:

* **Values distribution** - How visitors are distributed across values
* **Trend over time** - How the attribute changes
* **Visitor count** - Number of visitors per value

## Attribute best practices

### Name attributes clearly

Use descriptive, consistent names:

* "Loyalty tier" not "tier"
* "Account type" not "type"
* "Subscription status" not "sub\_stat"

### Don't duplicate system attributes

Check existing attributes before creating custom ones. AdaptiveCX already tracks device, browser, geography, and more.

### Keep attributes current

Update attributes when they change:

* Update loyalty tier when customer upgrades
* Set subscription status on purchase
* Update account type on plan change

### Don't store sensitive data

Avoid storing in attributes:

* Email addresses
* Names
* Phone numbers
* Any PII

Use anonymous identifiers instead.

## System attributes reference

AdaptiveCX automatically tracks these attributes:

### Device

* Device type
* Browser
* Operating system
* Screen resolution

### Session

* Session count
* Pages viewed
* Time on site
* Entry page
* Exit page

### Traffic

* Referrer
* UTM parameters
* Landing page
* Traffic source

### Geography

* Country
* Region
* City
* Timezone

### Behavior

* First visit date
* Last visit date
* Total sessions
* Recency


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/adaptivecx/getting-started/core/attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
