Kowal Data Layer
Composer kowal/module-datalayer · Version 0.1.33
Product page
Description
Publish store events to window.dataLayer so a Google Tag Manager container can read product, cart and purchase data.
For whom
For analytics teams measuring the journey from viewing a product to placing an order.
Features
- Individual event switches, including view_item, add_to_cart and purchase.
- Map the product identifier, brand and category.
- Optionally retain first-touch and last-touch attribution with the order.
Installation
From the Magento root, with Composer access to the Kowal package, run
composer require kowal/module-datalayer
bin/magento module:enable Kowal_DataLayer
bin/magento setup:upgrade
bin/magento cache:clean
Configuration
- Enable the module under Stores → Configuration → Kowal → Kowal Data Layer → General.
- In Product Mapping, select the product identifier used by your analytics setup. Enable the events you need under Events.
- Under Integrations, check how the GTM container is loaded. If the theme or another module already embeds it, leave Render GTM From DataLayer Module off.
Requirements / notes
The package requires PHP matching ^8.1 and Kowal Base. The browser event supplies data for a tag. Delivery to an analytics service depends on the container configuration and the user’s consent.
FAQ
How do I check which product identifier analytics receives?
Find a view_item event and compare the item_id in ecommerce.items with the attribute selected in Product Mapping.
Verify the installation
bin/magento module:status Kowal_DataLayer
In a test session, view a product and add it to the cart. Locate view_item and add_to_cart in GTM Preview and check the identifier, price and quantity for the same item.