# Attributes

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

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fiva56MewqaS8ADb4jyXo%2Fimage.png?alt=media&#x26;token=b69551f5-7276-427b-a234-9b097e32f24c" 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="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FqAiV4uKsKvjcg6dMTPpA%2Fimage.png?alt=media&#x26;token=5ef48268-a305-4b07-a519-1ed39bfe5999" 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="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FNgDj5Deqjx2MTRqpclyS%2Fimage.png?alt=media&#x26;token=34eb287e-e231-4c34-bb87-c2a33fe576c0" alt=""><figcaption></figcaption></figure>

### Visitor attributes

Personal characteristics:

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

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FGMdd6lkltpTz3TwnoKlv%2Fimage.png?alt=media&#x26;token=105ec179-fadf-4acf-9d8f-c6e2b4b222c1" 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="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2FUAkTCHKwmIr27CK0HB3b%2Fimage.png?alt=media&#x26;token=fcc32449-60d9-4773-ba54-b367a38955fe" 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
