Laioutr provides a tracking layer in the frontend that centralises how events (page views, add to cart, purchase, search, etc.) are sent to analytics and marketing tools. Your app (and Laioutr’s own components) call a single tracking store with a standard event shape. The store forwards each event to every tracking adapter that is currently active. Adapters can be gated by consent: an adapter only receives events if the user has granted the consent categories that adapter declares (e.g. statistics, marketing). That way you keep one event API and multiple backends (GTM, GA4, custom pixels, etc.) without duplicating consent logic everywhere.
This gives you:
['statistics', 'marketing']). They only receive events when the user has granted all of those categories in the consent store. Adapters that don’t set consent categories receive every event (they can handle consent themselves, e.g. via Google Consent Mode).page_view, add_to_cart, purchase, search, plus typed payloads). Adapters can map this to their own format (e.g. data layer, GA4 schema).The tracking store lives in @laioutr-core/frontend-core. Your Nuxt app must have this module so useTrackingStore() and the Analytics types are available. Tracking works best together with the consent management abstraction so adapters can be gated by the user’s choices.
The tracking store (useTrackingStore) is a global state that:
['statistics'] or ['statistics', 'marketing']).So: your app only calls pushEvent. The store decides which adapters receive each event based on registration and consent. Adapters that need consent should set consentCategories; adapters that handle consent themselves (e.g. GTM with Consent Mode) can omit it and receive all events.
Events follow the Analytics type: eventName (string) and payload (object). Laioutr defines standard event names and payloads (e.g. page_view, add_to_cart, view_item, begin_checkout, purchase, search, view_search_results, form_start, form_submit, custom) and typed payloads (currency, products, cartId, orderId, searchTerm, etc.). Use these from @laioutr-core/frontend-core (or your app’s imports) so adapters get a consistent structure. Custom events can use eventName: 'custom' and a flexible payload.
Example: send a page view and an add-to-cart from your code:
const trackingStore = useTrackingStore();
trackingStore.pushEvent('page_view', { pageType: 'home' });
trackingStore.pushEvent('add_to_cart', {
hasUserConsent: true,
currency: 'EUR',
cartId: 'gid://shopify/Cart/abc',
products: [{ productGid: '...', name: '...', brand: '...', price: 10, quantity: 1 }],
// ... other payload fields as needed
});
Adapters receive the same { eventName, payload } and can push it to the data layer, send it to an API, or transform it for their backend.
The tracking store uses the consent store (useConsentStore) to decide which adapters are active:
['statistics']), the store checks consentStore.hasCategoryConsent('statistics'). Only if that (and any other listed category) is true does the adapter get events.So: consent management defines “what the user allowed”; tracking uses that to decide “who gets the event.” For a new analytics or marketing adapter, set consentCategories to the categories that must be granted (e.g. ['statistics'] for analytics, ['marketing'] for ads) so you don’t send data without consent.
To send Laioutr events to another tool (e.g. a custom analytics endpoint, another tag manager, or a CRM):
'my-analytics').['statistics'] or ['statistics', 'marketing']). If present, the adapter only receives events when the user has granted all of these categories. Omit to receive all events (and handle consent yourself if needed).mode: 'client' or inside import.meta.client).The store will call your track function only when the adapter is active (i.e. when consent for consentCategories is granted, or when consentCategories is not set). You don’t need to check consent inside track if you use consentCategories; the store does that for you.
Laioutr ships a ready-to-use tracking app for Google Tag Manager. It registers a tracking adapter that pushes every event to the GTM data layer as { event: eventName, ...payload }, so you can configure tags and triggers in GTM to react to Laioutr events. The GTM app does not set consentCategories on its adapter: it receives all events and relies on Google Consent Mode for consent. It subscribes to the consent store and pushes consent updates (e.g. analytics_storage, ad_storage) to the data layer when the user grants statistics or marketing, so tags inside GTM can respect consent.
For setup and options, see the GTM app documentation.
['statistics']) so it only receives events when the user has granted those categories in the consent store. Adapters without consentCategories receive all events and can handle consent themselves (e.g. GTM + Consent Mode).Server-Side Rendering (SSR) and Caching
How the Laioutr frontend uses SSR by default, how to make pages cacheable, how to enable CDN and HTTP caching, and how to override behaviour in your own modules for custom SSR and caching.
Introduction
SEO features for the Laioutr frontend including robots.txt, per-page meta tags, and how to configure search engine crawling and indexing.