Odoo 19 app

GA4 eCommerce Tracking

Google Analytics 4 eCommerce tracking for Odoo - every shop event, every purchase once, refunds from the server, Consent Mode v2

What it does

The storefront sends GA4 enhanced ecommerce events with full items, the purchase is reported once per order, purchases the browser missed and refunds from credit notes go through the GA4 Measurement Protocol, and the Odoo cookies bar drives Google Consent Mode v2.

The module uses the Google Analytics key of your Odoo website as the GA4 measurement ID and sends the GA4 ecommerce events from the shop: view_item_list, select_item, search, view_item, add_to_cart, remove_from_cart, add_to_wishlist, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase, plus login, sign_up and generate_lead. Items carry id, name, variant, category, price, discount and quantity.

With an API secret the server can send the purchase through the GA4 Measurement Protocol when the customer's browser did not report it (ad blocker, closed tab), always, or instead of the browser, using the same transaction_id so nothing is counted twice. Credit notes and order cancellations can be sent as refund events. Every server event is logged with its request, HTTP status and answer, can be checked against the GA4 validation server and sent again.

Google Consent Mode v2 follows the Odoo cookies bar: basic or advanced mode, the default state of ad_storage, ad_user_data, ad_personalization and analytics_storage, regional defaults, wait_for_update, url_passthrough and ads_data_redaction. A debug mode adds debug_mode for GA4 DebugView, writes events to the browser console and shows them in a panel on the page.

Features

One GA4 setup per website
Consent Mode v2
Server events with the Measurement Protocol
view_item and the consent banner
add_to_cart with items
view_cart
Server events log
The request that was sent