Google Tag Manager: setup and help
Quick start
- Upload the
mprgoogletagmanagerZIP through Modules > Module Manager > Upload a module. - Click Configure, open Core, and enter your Container ID in
GTM-format followed by at least six uppercase letters or digits. - Set Enable Google Tag Manager to Yes and review the standard switches in Events.
- Review Traffic and Consent. Save, then run Diagnostics and repair hook order if indicated.
- Configure tags, variables, event triggers and consent requirements in your GTM workspace for the supplied dataLayer events.
- Open GTM Preview with a customer browser and check a product view, successful cart change and checkout.
- Place a test order and inspect
purchaseand its transaction reference. Configure and verify the optional GA4 server fallback separately before relying on it.
Requires PrestaShop 1.6 or later and PHP 7.1 or later.
Setup manual
Install and configure
Follow the steps in Quick start.
Core
Open Configure from Module Manager. The form has Core, Server-side, Events, Traffic and Consent tabs. Use the separate Diagnostics page for checks. License, Support, Update and Integrity controllers are also present.
| Setting | Default | What you configure |
|---|---|---|
| Enable Google Tag Manager | No | Enable the module's container and event integration. |
| Container ID | Empty | Enter GTM- followed by at least six uppercase letters or digits. |
Remove duplicate manual container loaders from your theme or other modules. The module also checks which MPR integration owns the configured container and GA4 destination. Resolve ownership before testing delivery.
Configure your GTM workspace yourself. Map the module's dataLayer event names and parameters to the tags you want to send, and set the appropriate consent requirements. Installing the module does not publish those GTM tags.
The module loads gtm.js through the shared browser runtime. The displayAfterBodyOpeningTag hook remains registered, but its current body template contains no noscript iframe. Do not use an iframe as your installation check.
Events
Each standard switch defaults to Yes. Disable the events you do not need.
| Setting | Source |
|---|---|
| view_item | Product page displayFooterProduct. |
| view_cart | Cart context fetched through the private tracking endpoint. |
| add_to_cart | Confirmed successful cart addition through shared commerce signals. |
| remove_from_cart | Browser cart removal/change handling. |
| begin_checkout | Native order or order-opc entry, with private cart context. |
| purchase | Eligible order confirmation, with a per-order browser claim. |
| login | Successful authentication, delivered through private pending visitor events. |
| sign_up | Account creation, delivered through private pending visitor events. |
| search | Internal search action, delivered through private pending visitor events. |
Cart events record successful quantity changes, rather than unsuccessful attempts to add a product. Test successful quantity changes in your theme.
Contact and product engagement
| Setting | Default | What it adds |
|---|---|---|
| Track contact signals | No | phone_click, an actual supported Tawk chat_start, and server-confirmed contact_form_submit to the dataLayer. Phone numbers and form values are excluded. |
| Track product engagement | No | high_intent_product_engagement, select_option, configurator_complete and add_to_cart_with_options. |
| Enhanced Conversions | No | Available hashed buyer data with the authorized purchase path when matching permission is present. |
| Track custom events | No | The configured custom rule engine. |
| Custom event rules | Empty | JSON rules described below. |
Product engagement uses defaults of 3 gallery interactions, 1 variant change, 1 detail interaction or 45 seconds. High intent is limited per product per page without session-storage deduplication in this GTM integration. Use GTM consent requirements for any receiving tags.
Enhanced Conversions is attached to eligible purchase data. It is not an unconditional separate enhanced_conversions_data event on every logged-in page. The module checks buyer matching permission before constructing that data.
Custom event rules
[
{"event":"gallery_browse","trigger":"click","selector":".product-images img,.images-container img","params":{"component":"product_gallery"},"once":false},
{"event":"promo_page_seen","trigger":"url","contains":["/special-offer"],"params":{"campaign_area":"landing_page"}},
{"event":"checkout_seen","trigger":"controller","controllers":["order","order-opc"]},
{"event":"gallery_open","trigger":"event","dom_event":"mpr:gallery-open","params":{"component":"product_gallery"}}
]
document.dispatchEvent(new CustomEvent('mpr:gallery-open'));
Names must start with a letter, use letters, digits or underscores, and have at most 40 characters. Reserved names/prefixes and personal-data-like parameter keys are filtered or rejected. Click selectors have a 500-character limit. once defaults to false for clicks and true for URL, controller and DOM-event rules. Configure GTM triggers for the exact custom names.
Traffic
Exclude logged-in employees defaults to Yes. The runtime checks staff/opt-out policy when it sends; shared public HTML can still contain static configuration for an excluded visitor. The private event endpoint applies its own eligibility checks.
Bot, crawler, audit-tool and headless-browser user agents are recognized by the traffic helper. A request made with curl is not equivalent to a normal customer-browser test.
To opt out a browser:
document.cookie = 'mpr_notrack=1; path=/; max-age=31536000; SameSite=Lax';
Consent
Emit Consent Mode fallback (when no CMP installed) defaults to Yes. The form describes the default-denied fallback for a shop without Cookies Revolution. Repair hook order is an action that moves this module last on displayHeader after the CMP. It is not a stored switch.
The active shared Google runtime also establishes denied defaults and reads live consent. GTM's container/dataLayer path delegates downstream tag consent to your GTM configuration. Private cart/pending events and purchase authorization require the applicable explicit analytics/service decision. Configure both the container's consent behavior and your CMP; a fallback is not a consent banner.
Test consent refusal, grant and withdrawal with the actual CMP and GTM tags. The runtime contains support for additional CMP readers, but this module's hook-order helper specifically detects Cookies Revolution. A missing buyer decision holds private/server purchase delivery.
Server-side
| Setting | Default | What you configure |
|---|---|---|
| Enable server-side purchase fallback | No | Admit eligible purchases to the shared GA4 server queue. |
| GA4 Measurement ID | Empty | Enter the target G- ID used by your intended GA4 stream. |
| Measurement Protocol API Secret | Empty | Enter the stream's secret, at least 20 letters, digits, underscores or hyphens. |
| Log Retention (days) | 90 | Set event-log cleanup age. Zero disables age-based cleanup. |
Save both credentials before enabling the fallback. It covers purchase only. The module records the buyer's GA client ID and analytics consent when the order is validated and checks them again before sending. A purchase without the buyer's own GA client ID is not sent; no replacement ID is generated. Staff orders, missing buyer data, ownership conflicts, outbound restrictions or a withdrawal can hold a purchase.
Order validation admits purchases to a durable queue; it does not directly send an HTTP request to GA4. The registered worker also discovers eligible recent purchases:
task: send_ga4_measurement_protocol
callable: mprgoogletagmanager::cronProcessMeasurementProtocolQueue
schedule: every:300
context: cron
timeout: 30
Make sure your shared MPR cron runner executes this task. The worker sends batches of 20; there is no batch-size field on this settings screen. The worker uses the buyer data recorded at checkout, never the cookies of the person running cron.
Browser and server payloads use the order reference as transaction_id, and a shared ledger stops the same order from being sent twice. Place a test order and check how it appears in your destination, including values and items.
Verify dataLayer output and diagnostics
Use Diagnostics > Run checks to review configuration, duplicate containers, hook order, module group visibility, custom JSON and server status. Use Repair hook order or Repair module group when indicated.
In GTM Preview, confirm each event name and inspect ecommerce.currency, ecommerce.value and ecommerce.items. Purchase data includes transaction reference, tax, shipping, coupons and available item fields such as ID, name, brand, category, variant, price and quantity. The integration clears the previous ecommerce object before pushing another ecommerce event.
Public output holds static configuration. Customer/cart/pending data is obtained through the authenticated private endpoint. Check that your cache does not serve private responses to another visitor. Check a test order in Preview and in the receiving analytics account after configuring and publishing the container.
Troubleshoot
If the container is missing, check the master switch, Container ID, destination ownership, browser staff policy, blocked scripts and missing shared assets. The current body template is intentionally empty.
If events are absent, check their switches, theme hook execution, the private endpoint response and consent. Use a successful cart change; the retained before-update hook does not emit events. A custom checkout may require its own rule or integration.
If server purchases are held, check the saved credentials, that the worker runs, the recorded buyer data, the original GA client ID and withdrawals. Check diagnostics and recent event logs. The log table uses your configured database prefix followed by mpr_analytics_events.
Disable or uninstall
Set Enable Google Tag Manager to No and save to pause the module's integration. Uninstall through Module Manager to remove its menu, module configuration and cron registration. This uninstall method does not explicitly delete event-log or queue rows. Shared infrastructure follows its schema retention rules; do not drop tables manually. Your GTM container and Google Analytics history remain in those services.
Reference screenshots
Use the setting names above when a reference screenshot differs from your installed version.






Questions
No questions about this module yet
Ask anything about installation, compatibility or setup. Answers appear here.
Known Issues
7
Tracking does not follow current consent and exclusions
Scheduled tracking tasks fail to install
Administration labels remain untranslated
Module fails to load on PHP 7.1
Storefront assets fail with asset combining
Overlapping modules can start duplicate tracking
Invalid container settings can be saved
Feature Requests
12
Implemented
Custom dataLayer event rules for GTM
Ecommerce event tracking
Server-side purchase fallback
Consent Mode integration
Enhanced Conversions
Custom event rules
Tracking diagnostics and event history
Demo event monitor
Updates from the back office
Multilingual administration
Contact interaction events
Product engagement events
Changelog
v1.2.142026-05-28
- Addedbrowser-side PrestaShop updateCart listener so add_to_cart and remove_from_cart are emitted reliably during AJAX cart updates.
- FixedactionCartUpdateQuantityBefore compatibility with PrestaShop branches that pass product objects and operator instead of id_product and operation.
- Addedlazy install-integrity banner and required-configuration warning for missing GTM Container ID.
- ChangedMeasurement Protocol fallback to stay disabled by default; GA4 Measurement ID and API Secret are required only when fallback is enabled.
- Refreshed shared MPR admin, license, update, config, compatibility, schema, and integrity packages.
- Updateddemo boot so GTM is preconfigured with a sample container, diagnostics are available, and server-side fallback remains disabled.
Older releases
v1.3.62026-05-27
- AddedAdd GTM custom dataLayer events
- AddedAdd GTM demo event monitor
- AddedHarden Google Tag Manager tracking
- Addedcomplete FR/DE/ES/IT/PL translations
- FixedRepair google tag manager admin parent menu
- FixedAdd GTM event log integrity check
- FixedAdd GTM custom-event diagnostics
v1.2.02026-04-11
- Addedecommerce dataLayer coverage for view_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, purchase, login, signup, and search.
- Addedoptional GA4 Measurement Protocol purchase fallback for stores that need server-side purchase recovery.
- Addeddiagnostics for hook order, consent defaults, duplicate tags, storefront HTML, and server-side event logs.
- AddedGoogle Consent Mode fallback when no CMP is installed.
v1.1.02026-02-15
- AddedGTM Container ID configuration and core browser container injection.
- Addedproduct and order ecommerce payload builders with currency, item, brand, category, variant, and order data.
v1.0.02025-07-18
- InitialGoogle Tag Manager integration for PrestaShop.
Demo
Test the full module before you buy
Buy a licence later and keep your settings.
- Your 30-day demo Test it on your own shop for 30 days from the first install.
- Ready demo shop Explore a ready demo shop in your browser.
- No registration No account, email or store domain needed.
By downloading, you accept the demo terms and privacy policy.
By opening this demo you accept the demo terms and the privacy policy.