Google Analytics 4 (GA4) & GTM

Presentation

The Google Analytics 4 (GA4) & GTM module for PrestaShop provides complete, reliable, and GDPR-compliant e-commerce tracking in just a few minutes. It automates the installation and configuration of Google Tag Manager and/or Google Analytics 4 without modifying the PrestaShop core and without overrides.

Built on a modern Symfony-based architecture, the module cleanly injects scripts through native PrestaShop hooks and implements 14 GA4-compliant e-commerce events. All essential data is transmitted: products, categories, prices, variants, taxes, shipping costs, coupons, and total order value.

It is designed for merchants, agencies, and developers who need accurate customer journey tracking, conversion optimization, and reliable marketing data.

Key benefits:

  • 14 complete GA4 e-commerce events
  • GTM and/or standalone GA4 support
  • Built-in Consent Mode v2 (GDPR compliant)
  • Google Search Console verification
  • Employee and IP exclusion
  • Multi-store compatible
  • No PrestaShop core overrides

Features

Main Feature

The core functionality of the module is automatic GA4 e-commerce tracking via Google Tag Manager or gtag.js. Simply enter your GTM ID (GTM-XXXXXXX) and/or GA4 Measurement ID (G-XXXXXXXXXX) to instantly activate tracking.

The module automatically pushes events to the dataLayer using the official GA4 structure. The purchase event includes:

  • transaction_id
  • value
  • currency
  • tax
  • shipping
  • coupon
  • items (products with full details)

The entire customer journey is covered: product view, product list view, add to cart, remove from cart, cart view, checkout start, shipping selection, payment selection, and order confirmation.

Additional Features

  • Consent Mode v2: Native management of analytics_storage, ad_storage, ad_user_data, and ad_personalization.
  • Automatic CMP detection: Built-in compatibility with Axeptio and Cookiebot.
  • Custom CMP integration: Public JavaScript function available for other solutions (OneTrust, Didomi, Tarteaucitron, etc.).
  • Google Search Console: Automatic injection of the verification meta tag.
  • Cross-domain tracking: Easy configuration for tracking users across multiple domains (GA4 standalone mode).
  • Smart exclusions: Employees logged into the back office are not tracked, with optional IP exclusions.
  • Debug mode: View tracking events directly in the browser console.
  • Multi-store support: Independent configuration per store (IDs, consent settings, exclusions).

Installation

  1. Download the module from your customer account
  2. In the PrestaShop back office, go to Modules > Module Manager
  3. Click Upload a module and select the ZIP file
  4. Configure the module according to your needs

Installation automatically registers the required hooks and initializes default settings. No core files are modified.

Configuration

General Settings

In the quick configuration tab, you must enter:

  • Google Tag Manager ID (e.g., GTM-ABC123)
  • Google Analytics 4 Measurement ID (e.g., G-1234567890)
  • Google Search Console verification code (content value of the meta tag)

If both GTM and GA4 are filled in, only GTM will be injected. In this case, GA4 must be configured inside your GTM container.

A status bar indicates whether tracking is active, how many events are enabled, and the current Consent Mode status.

Advanced Settings

Advanced settings provide full control over module behavior:

  • Individual activation/deactivation of the 14 GA4 events
  • Consent Mode v2 activation
  • Default consent states (granted / denied)
  • Debug mode activation
  • Back-office employee exclusion
  • Excluded IP address list
  • Cross-domain tracking configuration

These options allow you to adapt the module to your marketing strategy and technical environment.

Requirements

  • PrestaShop 8.x or 9.x
  • PHP 8.1 or higher
  • PHP extensions: json, pdo, mbstring
  • SSL (HTTPS) recommended

FAQ

Is the module compatible with my theme?

Yes, the module is compatible with all standard PrestaShop themes, including Classic (PrestaShop 8) and Hummingbird (PrestaShop 9), as well as most custom themes that properly use native hooks.

How can I get support?

Contact us via your customer account or by email. Please provide your PrestaShop and PHP versions, the theme you are using, your CMP, and a detailed description of the issue with screenshots if possible.

Support

Contact us via your WePresta customer account or by email.

Changelog

Version 1.0.0

  • Initial release
  • 14 complete GA4 e-commerce events
  • GTM and/or standalone GA4 support
  • Google Consent Mode v2 integration
  • Automatic Axeptio and Cookiebot detection
  • Google Search Console verification
  • Configurable cross-domain tracking
  • Employee and IP exclusions
  • Multi-store support
  • Compatible with PrestaShop 8.x and 9.x
Loading...