Google Tag Manager: setup and help

Quick start

  1. Upload the mprgoogletagmanager ZIP through Modules > Module Manager > Upload a module.
  2. Click Configure, open Core, and enter your Container ID in GTM- format followed by at least six uppercase letters or digits.
  3. Set Enable Google Tag Manager to Yes and review the standard switches in Events.
  4. Review Traffic and Consent. Save, then run Diagnostics and repair hook order if indicated.
  5. Configure tags, variables, event triggers and consent requirements in your GTM workspace for the supplied dataLayer events.
  6. Open GTM Preview with a customer browser and check a product view, successful cart change and checkout.
  7. Place a test order and inspect purchase and 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';

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.

Google Tag Manager, Gtm demo telemetry monitor

Google Tag Manager, Gtm product datalayer events

Google Tag Manager, Gtm search login events

Google Tag Manager, Storefront source gtm snippet

Google Tag Manager, Admin gtm diagnostics

Google Tag Manager, Storefront source purchase event

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

ResolvedUpdated:
Fixed in: 1.11.0
Tracking could use outdated consent or staff exclusion decisions when events were sent.

Scheduled tracking tasks fail to install

ResolvedUpdated:
Fixed in: 1.11.0
Installation could fail while preparing scheduled tracking tasks.

Administration labels remain untranslated

ResolvedUpdated:
Fixed in: 1.11.0
Some administration labels stayed in the source language despite available translations.

Module fails to load on PHP 7.1

ResolvedUpdated:
Fixed in: 1.9.6
The module could fail to load on PHP 7.1 because its installation requirements were generated incorrectly.

Storefront assets fail with asset combining

ResolvedUpdated:
Fixed in: 1.9.4
Tracking assets could fail to combine correctly when PrestaShop asset optimization was enabled.

Overlapping modules can start duplicate tracking

ResolvedUpdated:
Fixed in: 1.9.4
Browser and server-side tracking did not consistently respect the selected tracking module when integrations overlapped.

Invalid container settings can be saved

ResolvedUpdated:
Fixed in: 1.3.5
Invalid container identifiers could be saved and used for storefront tracking.

Feature Requests

12

Implemented

Custom dataLayer event rules for GTM

Implemented
Pushes custom dataLayer events for configured clicks, URL matches, PrestaShop controllers and DOM events. Define event names, triggers and parameters in the module's event settings without editing theme files.

Ecommerce event tracking

Implemented
Send product views, cart additions and removals, checkout, purchases, logins, signups and search events to Google Tag Manager.

Server-side purchase fallback

Implemented
Report purchases directly to GA4 when customers do not reach the confirmation page.

Consent Mode integration

Implemented
Apply consent defaults before loading Google Tag Manager.

Enhanced Conversions

Implemented
Optionally use customer information for conversion matching.

Custom event rules

Implemented
Configure custom events for clicks, page addresses, page types and browser events.

Tracking diagnostics and event history

Implemented
Review tracking configuration, duplicate tags and recent server-side event delivery in the back office.

Demo event monitor

Implemented
Inspect tracking events in the module demo.

Updates from the back office

Implemented
Check for and install module updates from the back office.

Multilingual administration

Implemented
Use the module administration in French, German, Spanish, Italian and Polish.

Contact interaction events

Implemented
Optionally send phone clicks, chat starts and contact form submissions to Google Tag Manager.

Product engagement events

Implemented
Optionally send product engagement events to Google Tag Manager.

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.
Launch demo shop

By downloading, you accept the demo terms and privacy policy.

By opening this demo you accept the demo terms and the privacy policy.

Loading...
Back to top