Data layer
Getting started
In this article, you will find information about available variables and events used in the data layer on a Yves Rocher websites. The data layer is a JavaScript object (array) that is used to pass data from a web page to the Google Tag Manager container. The data that the website passes to the data layer can then be used to create variables, rules, and tags.
RememberThe data layer contains all of the data generated by visitors and customers engaging with the Yves Rocher website.
Table of contents:
-
Available variables in the data layer
- yr_gtm_a
- yr_gtm_a1
- yr_gtm_ab
- yr_gtm_b
- yr_gtm_ac
- yr_gtm_c
- yr_gtm_ad
- yr_gtm_d
- yr_gtm_e
- yr_gtm_f
- yr_gtm_fa
- yr_gtm_g
- yr_gtm_h
- yr_gtm_k
- yr_gtm_l
- yr_gtm_m
- yr_gtm_n
- yr_gtm_u
- yr_gtm_aa
- yr_gtm_ae
- yr_gtm_ag
- yr_gtm_x
- yr_gtm_y
- yr_gtm_z
- ecomm_pagetype
- ecomm_totalvalue
- ecomm_prodid
- ecomm_prodidpl
- id_sekce
- visitorLoginState
- hashed_email
- hashed_phone_number
- phone_number
- address_info
-
Available data layer events
- page_view
- ecommerce / view_cart
- ecommerce / add_to_cart
- ecommerce / remove_from_cart
- ecommerce / add_shipping_info
- cart.change_address_data
- ecommerce / add_payment_info
- ecommerce / begin_checkout
- ecommerce / purchase
- ecommerce / view_item
- ecommerce / view_item_list
- website_error
- mgm.button_share
- mgm.button_copy
- wishlist_add
Available variables in the data layer
yr_gtm_a
Shows URL parameter for current altshop (used also in ?yras=… URLs)
Example: default
Available on: All pages
yr_gtm_a1
Shows Offer_segment value from current altshop settings.
Example: OfferSegment
Available on: All pages
yr_gtm_ab
Shows historic offer_segment values from the last 90 days in current altshop.
Example:
yr_gtm_ab | object |
- . | object |
.offer_segment | Old_offer |
.total_visits | 189 |
.total_orders | 8 |
Available on: All pages
yr_gtm_b
URL parameter of a current campaign code in current altshop
Example: CC1546592845
Available on: All pages
yr_gtm_ac
History of URL parameters of the campaign codes active in user session in last 90 days in current altshop
Example:
yr_gtm_ac | object |
.0 | CC1664286880 |
.1 | CC1661009512 |
.2 | CC1498480417 |
.3 | CC1658042828 |
Available on: All pages
yr_gtm_c
Current campaign code in current altshop
Example: 3CYLAWS11
Available on: All pages
yr_gtm_ad
URL parameters of a history of campaign codes active in user session in last 90 days
Example:
yr_gtm_ad | object |
.0 | 3CYLAWS11 |
.1 | 3CYL8WS11 |
.2 | 3CYGCWP01 |
.3 | 3CYL7WS11 |
Available on: All pages
yr_gtm_d
User fingerprint (RLC) stored in long lasting cookie.
Example: b51Fx9u0VgKaVkkKz1P1nGqZZknbNYRk5
Available on: All pages
yr_gtm_e
Customer hash. Non-empty only for sessions that can be connected with some customers.
Example: 062f89de75ddf516484a
Available on: All pages
yr_gtm_f
User type. There are the following types:
- "1" - Guest user, no information about a connection with any customer account
- "2" - User who has subscribed to newsletter
- "3" - Registered customer
- "4" - Registered customer with active VIP Zone subaccount (Member Club account)
Example: 4
Available on: All pages
yr_gtm_fa
Current customer VIP zone MC title.
Example: T0
Available on: All pages
yr_gtm_g
Count of customer orders from last 360 days.
Example: 7
Available on: All pages
yr_gtm_h
Date of last customer order (YYYY-MM-DD), only orders up to 360 days are taken into account.
Example: 2022-08-04
Available on: All pages
yr_gtm_k
Value of last customer order in websites currency, only orders up to 360 days are taken into account.
Example: 1000
Available on: All pages
yr_gtm_l
Average value of customer orders from last 90 days.
Example: 750
Available on: All pages
yr_gtm_m
List of product SKUs present in customer orders from last 360 days, excluding gifts
Example:
yr_gtm_m | object |
.0 | 97701 |
Available on: All pages
yr_gtm_n
List of gifts SKUs present in customer orders from last 360 days.
Example:
yr_gtm_n | object |
.0 | F02113 |
.1 | F94615 |
.2 | F67114 |
Available on: All pages
yr_gtm_u
Date of current visit (YYYY-MM-DD)
Example: 2022-10-25
Available on: All pages
yr_gtm_aa
Current visit status. There are the following statuses:
- 0 - standard visit (without order and abandoned cart).
- 1 - visit with an abandoned cart.
- 2 - visit with the placed order.
- Abandoned cart - another cart than current, with at least one product.
Example: 2
Available on: All pages
yr_gtm_ae
Date of previous visit (YYYY-MM-DD)
Example: 2022-10-24
Available on: All pages
yr_gtm_ag
Count of visits in last 360 days
Example: 607
Available on: All pages
yr_gtm_x
List of SKUs that the user saw during the current visit. Only SKUs seen on product pages are used.
Example:
yr_gtm_x | object |
.0 | 05241 |
.1 | 74084 |
.2 | 74084 |
Available on: All pages
yr_gtm_y
Example:
yr_gtm_y | object |
.0 | Kategorie: Vlasy > Masky a octy: Masky > Cílená péče: Detox vlasů |
.1 | Kategorie: Vlasy |
.2 | Kategorie: Vánoce |
.3 | Kategorie: Vánoce |
Available on: All pages
yr_gtm_z
Top X product SKUs in abandoned carts from last 90 days, without gifts.
Example:
-yr_gtm_z | object |
.0 | 22456 |
.1 | J0437 |
.2 | 83020 |
Available on: All pages
ecomm_pagetype
A type of page. Available types are:
- "home"
- "product"
- "category"
- "purchase" (orderend = order thank you page)
- "cart" (all other cart pages)
- "siteview" (visit on any site not meeting above conditions)
Example: product
Available on: All pages
ecomm_totalvalue
Total cart/order value without delivery method cost
Example: 2000
Available on: Only on pages with ecomm_pagetype = purchase/cart
ecomm_prodid
On purchase/cart pages: list of SKUs in order/cart, without gifts.
On product pages: current product SKU.
Example:
- On product page: "10399"
- On other pages: ["10399","J0346"]
Available on: Only on pages with ecomm_pagetype = purchase/cart/product
ecomm_prodidpl
On purchase/cart pages: list of SKUs in order/cart, without gifts.
On product pages: current product SKU.
On category pages: top X top-rated products found by selected filters.
Example:
- On product page: "10399"
- On other pages: ["10399","J0346"]
Available on: Only on pages with ecomm_pagetype = purchase/cart/product/category
id_sekce
On category pages: list of selected tags IDs.
On product pages: list of tags IDs from the most important feature assigned to the product (eg. Category).
Example: ["1246","1252"]
Available on: Only on pages with ecomm_pagetype = product/category
visitorLoginState
Current state of user log in state. There are currently two states:
- "0" = guest
- "1" = logged in customer
Example: 1
Available on: All pages
hashed_email
SHA256 hash of normalized user e-mail address.
Methodology: https://developers.google.com/google-ads/api/docs/conversions/enhance-conversions?hl=en#normalization_and_hashing
Example: "1b4f0e9851971998e7320785...edf7caa332359d6f1d83567014"
Available on: Only on the order thank you page (/cart/orderend, /cart/prepayment)
hashed_phone_number
SHA256 hash of normalized user mobile number.
Methodology: Google does not provide it. We normalize phone numbers to digits only and then hash them.
Example: "60303ae22b998861bce3...8a213c86c93c076dbe9f558c11c752"
Available on: Only on order thank you page (/cart/orderend, /cart/prepayment)
User e-mail address.
The field is generated only when unsafe user info is enabled within System > System / Settings > Integrations > Google Tag Manager
Example: "[email protected]"
Available on: Only on order thank you page (/cart/orderend, /cart/prepayment)
phone_number
User mobile number.
Field is generated only when unsafe user info is enabled within System > System / Settings > Integrations > Google Tag Manager
Example: "+48999999999"
Available on: Only on order thank you page (/cart/orderend, /cart/prepayment)
address_info
An object containing delivery address data of placed order. First and last names are hashed using SHA256.
Methodology: https://developers.google.com/google-ads/api/docs/conversions/enhance-conversions?hl=en#enhancement_adjustments
Fields "first_name" and "last_name" are generated only when unsafe user info is enabled within System > System / Settings > Integrations > Google Tag Manager
Example:
{
"hashed_first_name": "4f0e9851971998e...e59d6f1d83567014",
"hashed_last_name": "60303ae861bce3...8a213c86c9311c752",
"city": "Praha",
"postal_code": "11800"
}
OR
{
"hashed_first_name": "4f0e9851971998e...e59d6f1d83567014",
"hashed_last_name": "60303ae861bce3...8a213c86c9311c752",
"first_name": "Jan",
"last_name": "Kowalski",
"city": "Praha",
"postal_code": "11800"
}
Available on: Only on order thank you page (/cart/orderend, /cart/prepayment)
Available data layer events
page_view
Event Generated automatically by Google Analitycs. All events handled by GA4 have anonymized IP (it's non-configurable).
Event parameters: (GA4 generated)
altshop
Triggered on every page if "Track page loads as "altshop" event" is enabled in GA4 system settings.
Event parameters:
{
name: 'alt shop name'
}
ecommerce / view_cart
This even is triggered on cart page (/cart).
Event parameters:
{
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / add_to_cart
Triggered when a user adds an item to the cart. It applies only to regular 'add to cart' buttons. The value field contains the total row value after a change (determined by SKU). Items contain only elements with item_id equal to added SKU.
Event parameters:
{
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / remove_from_cart
Triggered when the user removes an item from the cart using "X" in cart table at /cart. The value field contains the total row value after a change (determined by SKU). Items contain only elements with item_id equal to added SKU.
Event parameters:
{
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / add_shipping_info
Triggered when user clicks on delivery method box on /cart/delivery (user changes delivery method).
Event parameters:
{
shipping_tier: 'delivery method name',
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}]
}
cart.change_address_data
Triggered when the user clicks on "add new address" button on /cart/delivery page.
Event parameters: No parameters.
ecommerce / add_payment_info
Triggered when user clicks on the payment method box on /cart/payment (user changes payment method).
Event parameters:
{
payment_type: 'payment method name',
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / begin_checkout
Triggered when "I confirm order" is clicked at the last step of the checkout process. Previously the event was triggered with every click of "next step" button.
Event parameters:
{
value: gross value of products,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / purchase
Triggered on /cart/orderend page. The legacy implementation also triggered this event on /cart/prepayment page but it does not comply with GA4 e-commerce events.
Event parameters:
{
transaction_id: 'order id with prefix',
affiliation: 'VPI',
value: gross value with shipping,
shipping: gross delivery + payment method cost,
currency: 'ISO currency code',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_variant: 'product attribute value / color name',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',z
currency: currency,
quantity: quantity
}],
shipping_tier: 'delivery method name'
}
ecommerce / view_item
This event is triggered on a product page.
Event parameters:
{
item_name: 'product name',
discount: 'difference between catalog_price and final price',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: catalog price,
value: final price for 1pc,
}
ecommerce / view_item_list
Triggered on product list pages i.e. Category, Search result, Featured list.
Event parameters:
{
item_list_name: 'Name of list',
items: [{
item_name: 'product name',
item_id: 'product SKU',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency
}]
}
website_error
Triggers whenever the user encounters an error on the website. Currently, there are 5 error types:
type: '404_error'
Triggered when a user enters 404 'not found' page.
type: 'wrong_discount'
Triggered when a user had activated the discount code that does not trigger any promotion rules. It's also triggered when the user had in the cart already used personal discount code.
type: 'missing_product_in_cart'
Triggered when some products were deleted from the cart due to low stocks.
type: 'old_offer_error'
Triggered when a customer is redirected to /auth/restricted.
type: 'zero_search'
Triggered when a customer entered search results page which did not return any results
mgm.button_share
Triggered when the user clicks on "share by e-mail" below the invitation link or code in a customer account.
Event parameters:
{
type: 'email'
}
mgm.button_copy
Triggered when user clicks on "copy" below invitation link or code in a customer account. This event triggers one of two parameters depending if the customer clicked copy below link or a code:
{
type: 'invitation_link'
}
or
{
type: 'invitation_code'
}
wishlist_add
Triggered when the user clicks on the wishlist button (small heart icon) which adds a product to the user's wishlist.
Event parameters:
{
item_name: 'product name',
item_id: 'product SKU',
item_brand: 'YvesRocher',
item_category: 'Product category',
price: final price for 1pc,
discount: 'difference between catalog_price and final price',
currency: currency
}