> For the complete documentation index, see [llms.txt](https://community.commandersact.com/datacommander/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community.commandersact.com/datacommander/user-manual/variables.md).

# Variables

## Default variables

### User universe

* 'User ID'&#x20;
* 'Hashed email address'&#x20;
* 'First visit date'&#x20;
* 'Last visit date'&#x20;
* 'Total page views'&#x20;
* 'Total conversion amount'&#x20;
* 'First conversion date'&#x20;
* 'Last conversion date'&#x20;
* 'Continent' 'Country'&#x20;
* 'Region' 'City'&#x20;
* 'Postal code'&#x20;
* 'User gender'&#x20;
* 'User age in years'&#x20;
* 'User postal code'&#x20;
* 'User address'&#x20;
* 'User firstname'&#x20;
* 'User lastname'&#x20;
* 'Timestamp'&#x20;
* 'Stream segment public IDs'&#x20;
* 'Stream segment labels'&#x20;
* 'Audience public IDs'&#x20;
* 'Audience labels'&#x20;
* 'User alias'&#x20;
* 'User category'&#x20;
* 'User agency'&#x20;
* 'User loyalty card id'&#x20;
* 'Last Device Name'&#x20;
* 'Last Device Type'&#x20;
* 'Total sessions'&#x20;
* 'User Id List'&#x20;
* 'User Email Hash List'&#x20;
* 'Is master user'
* 'Original Products Count'&#x20;
* 'Cancelled Products Count'&#x20;
* 'Returned Products Count'&#x20;
* 'Exchanged Products Count'&#x20;
* 'Final Products Count'&#x20;
* 'Total Original Conversion Amount'&#x20;
* 'Total Cancelled Conversion Amount'&#x20;
* 'Total Returned Conversion Amount'&#x20;
* 'Total Exchanged Conversion Amount'&#x20;
* 'Total Final Conversion Amount'&#x20;
* 'Number of conversions'&#x20;
* 'Date of First Conversion'&#x20;
* 'Date of Last Conversion'&#x20;
* 'Flags'

  |   |
  | - |

### Pageviews universe

* 'New session'
* 'Env template'&#x20;
* 'Env work'&#x20;
* 'Country'&#x20;
* 'Language'&#x20;
* 'Channel'&#x20;
* 'User ID'&#x20;
* 'User logged'&#x20;
* 'Gender'&#x20;
* 'Age'&#x20;
* 'Postal code'&#x20;
* 'Address'&#x20;
* 'Fistname'&#x20;
* 'Lastname'&#x20;
* 'Email (hashed)'&#x20;
* 'New customer'&#x20;
* 'Page Category 1 name'&#x20;
* 'Page Category 2 name'&#x20;
* 'Page Category 3 name'&#x20;
* 'Page Category 1 ID'&#x20;
* 'Page Category 2 ID'&#x20;
* 'Page Category 3 ID'&#x20;
* 'Key Words'&#x20;
* 'Product ID'&#x20;
* 'Product ID variation'&#x20;
* 'Product name'&#x20;
* 'Product name variation'&#x20;
* 'Product quantity'&#x20;
* 'Product unit price'&#x20;
* 'Product unit price discount'&#x20;
* 'Product URL'&#x20;
* 'Product Image URL'&#x20;
* 'Product Category 1 ID'&#x20;
* 'Product Category 2 ID'&#x20;
* 'Product Category 3 ID'&#x20;
* 'Product Category 1 name'&#x20;
* 'Product Category 2 name'&#x20;
* 'Product Category 3 name'&#x20;
* 'Product custom field 1'&#x20;
* 'Product custom field 2'&#x20;
* 'Product custom field 3'&#x20;
* 'Product custom field 4'&#x20;
* 'Product custom field 5'&#x20;
* 'Basket ID'&#x20;
* 'Basket custom field 1'&#x20;
* 'Basket custom field 2'&#x20;
* 'Basket custom field 3'&#x20;
* 'Basket custom field 4'&#x20;
* 'Basket custom field 5'&#x20;
* 'Order ID'&#x20;
* 'Order amount'&#x20;
* 'Order products number'&#x20;
* 'Conversion Product Name'&#x20;
* 'Products list'&#x20;
* 'Ordered products list'

If you need to map your segments:

* Stream segment labels => Labels of segments selected for the stream
* Stream segment public IDs => IDs of segments selected for the stream
* Audience labels => Labels of all segments to which the user belongs
* Audience public IDs => IDs of all segments to which the user belongs

### Q\&A

"Default variables" means ...

1. They are declared on each account per default? --> Yes, by our servers
2. They are populated automatically by DataCommander tag? No

'Custom variables' are variables that could be created especially for you, to suit to your business. \
Limits:&#x20;

Variable name : varchar(128)\
Variable shortname : varchar(55)

## TRUST variables

Consents from our product Trust (our Consent Management Platform) are stored on users and you can segment or export these values with these variables:

![Trust variables in Data Commander](/files/-MHzIjvsjxlZVYxsxpof)

## Variables types

### **String**

* Allows to treat all kinds of data, incl. "" (empty)
* Can come from collect, API, import&#x20;
* Can be used with text operator such as 'contains', 'begins with'...
* **All variables coming from MIX must be declared as String**
* **Limit: 32766 bytes**

### **Integer**

* Is either negative {-1, -2,-3, -4, -5, ... }, positive {1, 2, 3, 4, 5, ... }, or zero {0}
* Can come from collect, API, import&#x20;
* Can be used with numeric operators for segmentation
* **Limit: 2147483647 bytes**

{% hint style="danger" %}
Cannot be empty
{% endhint %}

### **Date**

* Please be careful when you try to use this very specific type
* Format is very specific: YYYY-MM-DDTHH:mm:ss
* Cannot be empty
* Can come from collect, API, import&#x20;
* Can be used for timing segmentation, in the past "ago" AND in the future "from now"&#x20;

### **Boolean**

* Is used to retrieve true / false for a specific information
* Can come from collect, API, import&#x20;
* Can be used in the segmentation either with 1/0 - true/false - T/F: these 3 options retrieve the same results, any other usage will retrieve the value of true

{% hint style="danger" %}

* Cannot be empty
* Be careful this is case sensitive!!!
  {% endhint %}

### **Float**

* Is whatever figure you want
* Cannot be empty
* Can come from collect, API, import&#x20;
* Can be used with numeric operator&#x20;

### **Object**

* Used to store several information in one variable

{% hint style="info" %}
Example: { age : 12, gender : M }
{% endhint %}

{% hint style="danger" %}

* Cannot be updated from collect data layer (because tag converts objects to strings); Can only be updated by API or FTP import
* Cannot be used for segmentation, only for exports
* Cannot be empty
  {% endhint %}

## Session variables

This is the list of proper variables you can use&#x20;

![](https://tagcommander.atlassian.net/wiki/download/attachments/266731542/image2018-6-15_11-43-16.png?version=1\&modificationDate=1529055797604\&cacheVersion=1\&api=v2)

### How to use them?

### Variables available in the user universe <a href="#howtousesessionsindata-variablesavailableintheuseruniverse" id="howtousesessionsindata-variablesavailableintheuseruniverse"></a>

* First session date / Last session date = the first / last session date that is associated to a TCID
  * date format
  * can be used for segmentation
  * available operators: beteween / not between + date range
* Count session = the number of sessions associated to a TCID for a specific date range
  * integer
  * can be used for segmentation
  * available operators: exactly / at least / at most + date range&#x20;
* Total session = the total number of sessions associated to a TCID
  * integer
  * can be used for segmentation
  * available operators: all operators that can be used for integers&#x20;
  * as a classic user property there is no date range

![](https://tagcommander.atlassian.net/wiki/download/attachments/266731542/image2018-6-15_11-42-34.png?version=1\&modificationDate=1529055756394\&cacheVersion=1\&api=v2)

### Variable available in the page view universe <a href="#howtousesessionsindata-variableavailableinthepageviewuniverse" id="howtousesessionsindata-variableavailableinthepageviewuniverse"></a>

* New session = the first session variable populated on pageviews&#x20;
  * boolean&#x20;
  * can be used for segmentation (but honestly quite complicated to really use it...)
  * available operators: equals T/F
  * **Be careful: it never matches 100% as you have many TCID older than 30 days where the variable new session in page views is not populated**

![](https://tagcommander.atlassian.net/wiki/download/attachments/266731542/image2018-6-15_11-45-10.png?version=1\&modificationDate=1529055911379\&cacheVersion=1\&api=v2)

## Variable encryption

*Some information about how data is encrypted in DataCommander (in AES 256 format)*

If you need encrypted data in DataCommander don't forget to pick 'Yes' in encrypted option in Create variable step.

![](/files/-LqukDZkNi5cTNngbGJi)

This is the encryption scheme:

| DATA      | Start | SSL       | FTP Server | In base   | In Export |
| --------- | ----- | --------- | ---------- | --------- | --------- |
| Datalayer | Clear | encrypted | -          | encrypted | Clear     |
| CSV file  | Clear | encrypted | Clear      | encrypted | Clear     |

It means that we store encrypted data, and we are able to export clear data for our partners.

{% hint style="danger" %}
**It is very important especially for emails, as it is a sensitive data that many clients want to over-secure, but we need to export it in clear for emailers to be able to use it**
{% endhint %}
