Analytics and consent
Analytics run in the browser only, through Google Tag Manager, and only when NEXT_PUBLIC_GTM_ID is set. Unset, nothing loads.
Consent
Section titled “Consent”- Consent Mode v2 starts with
ad_storage,ad_user_data,ad_personalizationandanalytics_storageall denied. - The cookie banner offers necessary, analytics, marketing and preferences. The visitor’s choice updates Consent Mode and is stored in the browser (
magenx_cookie_consent). - A footer link reopens the preferences at any time.
- Events are pushed to the data layer regardless; consent decides whether Google may store cookies. That is how Consent Mode v2 is meant to work.

The cookie policy page lists the cookies the site really sets, from the GDPR module’s cookie registry, and consent decisions can be logged there for audit.
Ecommerce events
Section titled “Ecommerce events”| Event | When |
|---|---|
view_item_list | A tracked product list renders or changes (page, sort, filter, tab). |
select_item | A product card is clicked in a tracked list. |
view_item | A product page is viewed. |
add_to_cart / remove_from_cart | Add to cart; quantity changes on the cart page. |
view_cart | The cart page opens with items (once per visit). |
add_to_wishlist | A product is added to the wishlist. |
begin_checkout | Checkout opens with items (once). |
add_shipping_info | The shipping step is saved (shipping_tier = method code). |
add_payment_info | The payment step is saved, including before the PayPal redirect (payment_type = method code). |
purchase | The order confirmation page (once per order). |
search | A search results page for a new term. |
login / sign_up / logout | Sign-in (method: password or social), registration, sign-out. |
purchase carries transaction_id, value, currency, tax, shipping, coupon and items[]. List events carry item_list_id and item_list_name (fixed English names such as search_results or category_<id>) and each item’s position.
Core Web Vitals
Section titled “Core Web Vitals”LCP, CLS, INP, FCP and TTFB from real visitors are sent to GA4 (web_vitals event). For the same field data without GTM, turn on Cloudflare Web Analytics for the shop domain (Analytics & Logs > Web Analytics): it measures at the edge and needs no code in the storefront.
The tracking helpers are in apps/theme/src/lib/analytics/gtag.ts; the components in Components: Analytics.