Skip to main content

Tag data model

J
Written by Jerome LEBLEU
Updated today

raw_hits

The raw_hits table is a "hit" scope table. This means it records all incoming tag calls (page_view or event).


Syncing

Hits appear in the raw_hits table once the session to which they belong has expired, which occurs after a 30-minute period of inactivity following the last hit.


<a href="https://dbdiagram.io/e/65c0ca08ac844320ae7740d3/67a5e256263d6cf9a06049b8" rel="nofollow noopener noreferrer" target="_blank">https://dbdiagram.io/e/65c0ca08ac844320ae7740d3/67a5e256263d6cf9a06049b8</a>

Fields definition

datetime

Date and time when the hit was recorded. Automatically created by Quanti: but overridable if is needed.

hit_id

Unique hit identifier. Automatically created by Quanti:.

session_id

Unique session (can be also called visit) identifier. A session is a set of events from the same visitor. It ends when the tag does not record any events for 30 minutes. session_id is automatically created by Quanti: from the value of a cookie placed on the user's browser by the tag. A visitor can make multiple sessions. session_id can be modified. it means you can override by pushing your own value in the tag

visitor_id

Unique visitor identifier. Automatically created by Quanti: from the value of a cookie placed on the user's browser by the tag. One visitor = One browser. A visitor_id can be associated to multiple hit_id and session_id. It can be overridable if is needed like in a server-side setup.

user_id

Unique user identifier. This identifier has to be specify in the tag. Typically the value is based on a hashed version of the user's email address (using SHA256, for example).

A user (identified by a user_id) can have several devices, and therefore several browsers (identified by several visitors_id). They can have multiple sessions (identified by multiple session_id) during which they navigate from page to page and record multiple events, event and page_view (identified by multiple hit_id).

Explanation of the Different Types of Identifiers

Explanation of the Different Types of Identifiers

device_type

The type of device automatically recovered by the tag when the hit was recorded. 3 possible values : desktop, mobile, or tablet. It can be overridable if is needed like in a server-side setup.

url

The current URL of the page automatically recovered by the tag the hit was recorded but overridable if is needed like in a server-side setup.

conversion_id

Unique conversion identifier. This identifier is generally generated by your site / back-end and it has to be specify in the tag. It makes possible to identify each conversion. This field is logically populated only on the hit that recorded the conversion.

conversion_value

Monetary value of the conversion generated by the site and specify in the tag. This field is logically populated only on the hit that recorded the conversion.

conversion_type

The type of the conversion generated by the site and specify in the tag. It can be a lead, a purchase, a secondary conversion, etc. This field is logically populated only on the hit that recorded the conversion.

consent

The value of consent expressed by the user upon arrival on the site and retained throughout their navigation. It generated by the site and specify in the tag. This field can be used to do statistics on the consent users by filling it with a list of vendors or typologies of cookies accepted by the user.

event

The type of event. This can be an 'event' or a 'pageView' depending on what was specified in the tag when the hit was recorded.

event_category

A parameter useful to categorize events. Typically the object that was interacted with. It has to be specify in the tag.

event_action

A parameter useful to categorize events. Typically the type of interaction. It has to be specify in the tag.

event_label

A parameter useful to categorize events. Typically label given to the event. It has to be specify in the tag.

event_value

Numeric value associated with the event. It has to be specify in the tag.

account_id

Unique account identifier given by Quanti: during tag creation. It can't be modified.

referrer

The referrer is the visitor's originating page. In other words, it is the page that precedes the tag call. Automatically recovered by the tag during the hit but overridable if is needed like in a server-side setup.

user_agent

Technical informations about your browser. Automatically recovered by the tag during the hit but overridable if is needed like in a server-side setup.

product_ids

A parameter useful to recover informations about products. usually a JSON is pushed in this field

ad_user_data

Controls the sending of user-identifiable data for advertising purposes.

ad_storage

Controls the use of data for personalized advertising (e.g., remarketing, audience targeting).

ad_personalization

Controls the use of local storage for advertising purposes (e.g., marketing cookies).

analytics_storage

Controls the use of storage for analytics data.

raw_sessions

The raw_sessions table is a "session" scope table. It records every sessions of all users, which are defined by a succession of events within a given time.


Syncing

The new sessions appear in the raw_sessions table once the session has expired, which occurs after a 30-minute period of inactivity following the last hit.


<a href="https://dbdiagram.io/e/65c0ca08ac844320ae7740d3/67a5e256263d6cf9a06049b8" rel="nofollow noopener noreferrer" target="_blank">https://dbdiagram.io/e/65c0ca08ac844320ae7740d3/67a5e256263d6cf9a06049b8</a>

Fields definition

datetime

Date and time of the start of the session. The datetime of a session is calculated from raw_hits table: Quanti: takes the datetime's value from session's first hit.

session_id

Unique session identifier. A session (also called visit) is a set of events from the same visitor within a given amount of time. It ends when the tag does not record any events for 30 minutes. session_id is automatically created by Quanti:. A visitor can make multiple sessions. session_id can be overridable

visitor_id

Unique visitor identifier. Automatically created by Quanti: based on the value of the cookie placed on the user's browser, by the tag itself. One visitor = one browser. A visitor can make multiple hits and sessions. Its value is overridable if needed.

user_id

Unique user identifier from the client / contact base. This identifier has to be specified in the tag. It is typically based on a hashed version of the user's email address (using SHA256, for example). The user_id of a session is calculated from raw_hits table. Quanti: takes the last known value (different from empty or null values).

A user (identified by a user_id) can make sessions (identified by multiple session_id) on multiple devices, and as a result, several browsers (identified by different visitors_id). For each user, pages and events are recorded (identified by different hit_id).

Explanation of the Different Types of Identifiers

Explanation of the Different Types of Identifiers

device_type

The type of the device used to navigate. 3 possible choices: desktop, mobile, or tablet. The device_type of a session is calculated from the raw_hits table. For each session, the value is taken from the last hit.

landing_url

First page of a session. The landing_url of a session is calculated from raw_hits table.

exit_url

Last page of a session. The exit_url of a session is calculated from raw_hits table.

s_source

The s_source field is the traffic source of a session. It is calculated from raw_hits table. Quanti: applies rules to determine its value based on information contained in the url field and the referrer field of session's first hit.

To learn more about Campaign parameters calculated rules, read this attribution calculated rules.

s_medium

The s_medium field is the traffic medium of a session. It is calculated from raw_hits table. Quanti: applies rules to determine its value based on information contained in the url field and referrer field of session's first hit.

To learn more about Campaign parameters calculated rules, read this article.

s_campaign

The s_campaign of a session is calculated from raw_hits table. Quanti: extract value of utm_campaign parameter of session's first hit.

s_content

The s_content of a session is calculated from raw_hits table. Quanti: extract value of utm_content parameter of session's first hit.

s_keyword

The s_keyword of a session is calculated from raw_hits table. Quanti: extract value of utm_term parameter of session's first hit.

s_utm_id

The s_keyword of a session is calculated from raw_hits table. Quanti: extract value of utm_id parameter of session's first hit.

s_consent

The value of consent given by the user upon arrival through your consent management platform. The s_consent of a session is calculated from raw_hits table. Quanti: keeps the last value known from session's hits.

s_referrer

The referrer is the visitor's originating page, or in other words, the page that precedes the opening of the session. The s_referrer of a session is calculated from raw_hits table: Quanti: takes the referrer's value from session's first hit.

page_views

The number of page views counted during the session.

events

The number of events counted during the session.

total_conversions

The number of conversions counted during the session.

total_conversion_values

The sum of conversions values counted during the session.

account_id

Unique account identifier given by Quanti: during tag creation. It can't be modified.

s_ad_user_data

Calculated from the raw_hits table. For each session, we keep the last known value.

s_ad_personalization

Calculated from the raw_hits table. For each session, we keep the last known value.

s_ad_storage

Calculated from the raw_hits table. For each session, we keep the last known value.

s_analytics_storage

Calculated from the raw_hits table. For each session, we keep the last known value.

advanced_attribution

The advanced attribution table is a “conversion” scope table. It records all conversions made and attributes them to the sessions that participated.


Syncing

The advanced attribution table is a view.

8KB

DownloadOpen


Description

Technical Definition of a conversion

From a technical perspective for Quanti, a conversion is a hit where the value of the conversion_id parameter is not null, undefined, or empty. One of these conditions must be satisfied to add a new row in the advanced attribution table.

Primary keys explanations

The advanced attribution table's primary keys are hit_id and s_session_id :

  • We have made the decision to insert a field named hit_id into the table, which precisely identifies the hit that registered the conversion from raw_hits. This ensures the table's integrity by addressing a potential issue with the uniqueness of conversion_id. hit_id is technically more precise than the conversion_id.

  • The s_session_id is the second primary key of the table and allows linking a session to a conversion. Multiple sessions can participate in the same conversion, and the same session can participate in multiple conversions.

In this table, a single conversion_id can be used across multiple rows because it may have been generated by a series of sessions (One row in the table = one session for a given conversion). Similarly, a session_id can also be used on multiple rows because it might have originated several conversions. However, what is essentially maintained is the presence of a unique session_id per conversion.

Attibution rules

We have 2 ways to catch up on sessions and assess their contribution to achieving a conversion :

  • By visitor_id : We log all previous sessions that have the same visitor_id as the session during which the conversion occurred.

  • By user_id : We log all previous sessions that have the same user_id as the session during which the conversion occurred.

The values null, undefined, or empty for visitor_id and user_id are obviously excluded from the attribution calculation rules.

The paths

Now that you've understood that the table consists of a list of sessions that contributed to achieving conversion(s), it's crucial to know how you can distinguish them from a chronological perspective and especially how you are going to analyze the paths taken by your visitors and calculate the contribution of each session. There is evidently the "s_datetime" field which gives the exact date and time of the session's start, but we have made the task easier for you by implementing two fields:

  • max_index: Indicates the total number of contributive sessions related to a conversion. The value of this field is the same for each session (row) for a given conversion.

  • path_index: indicates the chronological position of the session among all the contributory sessions leading to a conversion.

For a conversion tracking multiple contributive sessions, you will therefore have in path_index numbers ranging from 1 to the number representing the total number of sessions. Then, on each line in max_index, you will find the maximum number that represents the total number of sessions.

Example of filling in the path_index and max_index fields

Example of filling in the path_index and max_index fields

Fields definition

hit_id

Unique hit identifier automatically created by Quanti: which registering the conversion.

s_session_id

Unique session identifier automatically created by Quanti: which linked the conversion.

Learn more about session_id.

s_visitor_id

Unique visitor identifier automatically created by Quanti: which linked the conversion.

Learn more about visitor_id.

c_user_id

Unique user identifier from the client / contact base which linked the conversion.

c_conversion_id

Unique conversion identifier from the client generated by the site and specify in the tag.

c_conversion_type

The type of the conversion generated by the site and specify in the tag.

c_conversion_value

Monetary value of the conversion generated by the site and specify in the tag.

c_date

DATE type field indicating the generation date of the conversion.

c_datetime

DATETIME type field indicating the generation date of the conversion.

s_date

DATE type field indicating the date of the session.

s_source

The s_source field is the value of utm_source parameter of the session arose from raw_sessions table.

Learn more about s_source.

s_medium

The s_medium field is the value of utm_medium parameter of the session arose from raw_sessions table.

Learn more about s_medium.

s_campaign

The s_campaign field is the value of utm_campaign parameter of the session arose from raw_sessions table.

Learn more about s_campaign.

s_content

The s_content field is the value of utm_content parameter of the session arose from raw_sessions table.

Learn more about s_content.

s_keyword

The s_keyword field is the value of utm_term parameter of the session arose from raw_sessions table.

Learn more about s_keyword.

s_utm_id

The s_utm_id field is the value of utm_id parameter of the session arose from raw_sessions table.

Learn more about s_utm_id.

s_consent

The s_consent field is the value of s_consent field of the session arose from raw_sessions table.

Learn more about s_consent.

s_referrer

The s_referrer field is the value of s_referrer field of the session arose from raw_sessions table.

Learn more about s_referrer.

s_ad_user_data

The s_ad_user_data field is the value of s_ad_user_data field of the session arose from raw_sessions table.

Learn more about s_ad_user_data.

s_ad_personalization

The s_ad_personalization field is the value of s_ad_personalization field of the session arose from raw_sessions table.

Learn more about s_ad_personalization.

s_ad_storage

The s_ad_storage field is the value of s_ad_storage field of the session arose from raw_sessions table.

Learn more about s_ad_storage.

s_analytics_storage

The s_analytics_storage field is the value of s_analytics_storage field of the session arose from raw_sessions table.

Learn more about s_analytics_storage.

path_index

Chronological position of the session among all the contributory sessions leading to a conversion. The value "1" represents the session that is the furthest away chronologically from the conversion. The session closest to the conversion (being the one during which the conversion took place) will have the highest number and will be equal to the value of the field max_index defined below.

max_index

The total number of contributive sessions related to the conversion (define by hit_id value). The value of this field is the same for each session (row) for a given conversion.

lookback_window

The total number of days between the conversion date and the session date.

is_last_clic

Boolean field indicating if the session (the row) is the session that led to the conversion. Technically, this is the session for which path_index = max_index.

is_last_clic_non_direct

Boolean field indicating if the session (the row) is the session that led to the conversion after excluding all sessions with a s_source value (direct) and a s_medium value (none). Technically, this is the session for which path_index is the highest (After excluding (Direct) sources). If the conversion is carried out in a single session with s_source value (direct) and a s_medium value (none), then this single session is considered as the LCND. If the conversion is conducted through multiple sessions but all of them have the s_source value (direct) and the s_medium value (none), then the most recent one of these is considered the LCND.

is_post_clic_30

Boolean field indicating if the session (the row) occurred within the 30 days preceding the conversion. Technically, this is the difference between s_date and c_date.

is_post_clic_60

Boolean field indicating if the session (the row) occurred within the 60 days preceding the conversion. Technically, this is the difference between s_date and c_date.

is_post_clic_90

Boolean field indicating if the session (the row) occurred within the 90 days preceding the conversion. Technically, this is the difference between s_date and c_date.

is_post_clic_120

Boolean field indicating if the session (the row) occurred within the 120 days preceding the conversion. Technically, this is the difference between s_date and c_date.

is_post_clic_180

Boolean field indicating if the session (the row) occurred within the 180 days preceding the conversion. Technically, this is the difference between s_date and c_date.

is_first_clic_30

Boolean field indicating if the earliest session of the path is occurred within the 30 days preceding the conversion. Technically, this is the difference between s_date and c_date and it concern only session with a path_index = 1.

is_first_clic_60

Boolean field indicating if the earliest session of the path is occurred within the 60 days preceding the conversion. Technically, this is the difference between s_date and c_date and it concern only session with a path_index = 1.

is_first_clic_90

Boolean field indicating if the earliest session of the path is occurred within the 90 days preceding the conversion. Technically, this is the difference between s_date and c_date and it concern only session with a path_index = 1.

is_first_clic_120

Boolean field indicating if the earliest session of the path is occurred within the 120 days preceding the conversion. Technically, this is the difference between s_date and c_date and it concern only session with a path_index = 1.

is_first_clic_180

Boolean field indicating if the earliest session of the path is occurred within the 180 days preceding the conversion. Technically, this is the difference between s_date and c_date and it concern only session with a path_index = 1.

Did this answer your question?