Types of Data Points

Introduction

There are three types of data points you should get familiar with:

Both in the application and this documentation, data points are marked with a capital letter E, M or A (in brackets or in a circle) to make it clear what type of data point is being tracked, allowed in a query or just discussed.

(M) and (E) events describe everything that users do on your website. When they open pages (M) Section and (M) URL events are tracked. When the interact with elements on those pages, hover over content (E) mouseover, click buttons (E) click, or fill in form fields (E) change, these events are tracked with information about what exactly happened and when. Events can also describe how your website responded to user behavior, for example what form validation errors (M) Error were displayed upon submission of an incomplete form.

The same event can happen many times during the same visit as a user can click the same button twice or view the same page again.

This is what differentiates events from (A) attributes which are designed to store values that either don’t change during a visit (for example Browser, Country, Gender, Referrer) or, when they change, their final state is more important than changes to that state (for example Basket Value).

types-of-events

* the tracking code does not track any content that is displayed on the page, unless specifically configured to do so, in order to avoid unintended collection of personal or sensitive data.

(E) Interactive Events

Interactive events contain information about user interactions with the elements of your website: clicked buttons, hovered images, changed form values, etc.

Examples of interactive events:

Interactive events are automatically collected by the UseItBetter script and formed based on the structure of your HTML and ids and classnames assigned to the elements on the page. The only way you can control how events are being captured is by modifying your website’s HTML code.

Understanding how (E) Interactive Events are formed and tracked is crucial to effective use of UseItBetter. You can learn more about this in a separate article.

If you are familiar with HTML, CSS and JavaScript, the syntax of (E) Interactive Events should be straightforward for you.

Similarities to CSS Selectors

The interactive events are very similar to standard CSS selectors that developers use to style the look of elements on a page or assign functions to them in JavaScript.

For example, here is a UseItBetter event consisting of a selector and event type click:

div[1]#checkout/a[1].button.continue.click

And here is a CSS selector referring to the same element:

div#checkout > a.button.continue {
  background: green;
  font-weight: bold;
}

Finally, here is a JavaScript example using jQuery to assign the element a behavior for the click event:

$('div#checkout > a.button.continue').on('click', function(e) {
  // do something on click 
});

(M) Meta Events

Meta Events usually describe content the user is seeing, or the state of the user’s visit, for example:

but meta events can also contain information about key actions users take:

The examples above use three predefined meta events types that you should become familiar with: Section, Action and Error. You can also track your custom meta events using triggers or a JavaScript SDK method.

Saving Meta Events using JavaScript SDK API

uDash.saveMeta("key","value");

For example:

uDash.saveMeta("ProductPrice",330);
uDash.saveMeta("ProductName","iPhone 6");

(A) Attributes

Examples of attributes:

Every visit can have only one value for an attribute of the same key. If a user visits your website and it is their first visit, the value of the userVisit attribute will not change until they visit your website again.

If the same attribute is collected during a single visit more than once, only the last value will be associated with the visit and the previous values will be erased.

You can collect additional attributes using triggers or a JavaScript SDK API method.

Saving Attributes using the JavaScript SDK API

uDash.saveAttribute("key","value");

For example:

uDash.saveAttribute("Revenue",330);
uDash.saveAttribute("New Customer",true);

Difference Between (M) Meta Events and (A) Attributes

Both Meta Events and Attributes have the same syntax and consist of a key/value pair. What makes them different is that Meta Events of the same key can have multiple values per visit and Attributes can have exactly one value.

For example, if you would like to track the basket value in a visit, you would save Basket Value every time the user adds or removes something from a basket.

If you use attributes and update the basket value during two visits:

Visit 1: Visit 2
(A) Basket Value = 0
(A) Basket Value = 100
(A) Basket Value = 70
(A) Basket Value = 0
(A) Basket Value = 50
(A) Basket Value = 0

only the last basket value would be preserved in those visits. Therefore if you sum the basket values, the total basket value in those two visits would be 70 (70 + 0).

If you save the same basket values as (M) meta events, all values would be preserved and the total basket value would be 230 (0 + 100 + 70 + 0 + 50 + 0).

In some cases, it can be useful to track the same values as both (M) meta events and (A) attributes. Such an approach would, for example, allow you to find visits in which users at some point had (M) basket value > 0 but at the end of a visit the (M) basket value = 0.