Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries ⟶
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    • Affiliate Program
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Website
  3. GA4 eCommerce Tracking - Google Analytics 4 Enhanced eCommerce, GA4 Measurement Protocol, Google Consent Mode v2 v 19.0
  4. Sales Conditions FAQ

GA4 eCommerce Tracking - Google Analytics 4 Enhanced eCommerce, GA4 Measurement Protocol, Google Consent Mode v2

by Modvanta https://modvantaapps.tech/odoo-apps/ga4-tracking/
Odoo

$ 29.91

v 19.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
You bought this module and need support? Click here!
  • Description
  • Manifest
  • License
GA4 eCommerce Tracking for Odoo 19 - Google Analytics 4 enhanced ecommerce events, Measurement Protocol purchases and refunds, Google Consent Mode v2
Odoo 19Google Analytics 4Enhanced eCommerce EventsMeasurement ProtocolConsent Mode v2Server Purchases and RefundsDebug Panel

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

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.

Buy Now - $30Ask a Question

Written and supported by Modvanta - modvantaapps@gmail.com

What it does

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.

Who it is for

Odoo eCommerce shops

Get GA4 ecommerce reports with real item data instead of page views only.

Stores losing purchases to ad blockers

Let the server report the purchases the browser did not send, once per order.

Shops selling in the EU

Respect the visitor's cookie choice with Google Consent Mode v2 on the Odoo cookies bar.

Key features

Every screen below is the module running on Odoo 19. The server events went to a local stand-in for Google (placeholder measurement ID and API secret), which answers like the real collection server.

Feature 1

One GA4 setup per website

Measurement ID, Measurement Protocol API secret, server container URL, the Odoo cookies bar, item id and brand attribute, who is tracked (no internal users, no known bots, user ID, user properties, debug mode) and when the purchase is reported. Test Server Connection sends a test event to the GA4 validation server.

One GA4 setup per website

Feature 2

Consent Mode v2

Basic mode (Google tag only after consent) or advanced mode (tag at once, cookieless pings until consent), the default state before the visitor answers, what the Agree button grants, regional defaults, wait_for_update, url_passthrough and ads_data_redaction.

Consent Mode v2

Feature 3

Server events with the Measurement Protocol

Purchase by the server: browser only, server when the browser did not report it, browser and server with the same transaction_id, or server only, with the wait time. Refunds from credit notes and on order cancellation, consent requirement, collection endpoint (global or EU), send attempts and how long events are logged.

Server events with the Measurement Protocol

Feature 4

view_item and the consent banner

On a product page the view_item event is sent with the full item; the debug panel shows the measurement ID, consent state, consent mode and every event, while the Odoo cookies bar asks for consent.

view_item and the consent banner

Feature 5

add_to_cart with items

Adding to the cart sends add_to_cart with currency, value and the item, after the visitor accepted cookies.

add_to_cart with items

Feature 6

view_cart

The cart page sends view_cart with all cart lines.

view_cart

Feature 7

Server events log

Every server purchase and refund with transaction id, value, currency, consent, state, send time, HTTP status and answer. An order without a cookie choice is logged as not sent with the reason.

Server events log

Feature 8

The request that was sent

Each event keeps the exact Measurement Protocol request with client_id, transaction_id, value, tax, shipping and items, the HTTP status and Google's answer; Validate with Google posts it to the validation server.

The request that was sent

How it works, step by step

1

Install and enter the measurement ID

Put your GA4 measurement ID (G-...) as the website's Google Analytics key and switch GA4 eCommerce Tracking on.

2

Add an API secret for server events

Create a Measurement Protocol API secret in GA4 Admin and paste it; Test Server Connection sends a test event to the validation server.

3

Set consent

Enable the Odoo cookies bar and pick basic or advanced Consent Mode v2 and the default states.

4

Check with the debug panel

Turn on debug mode and open the shop with ?ga4_debug=1 to see every event on the page and in GA4 DebugView.

5

Let orders and refunds flow

Confirmed website orders report the purchase once; credit notes send refunds; follow both in the events log.

Settings

Settings are per website, under the website's GA4 Tracking form and in the Website settings.

Google Analytics 4Enable tracking, measurement ID, API secret, server container URL, Odoo cookies bar.
Events and itemsValues with or without taxes, item_id from internal reference or product ID, brand attribute, events not to send.
Who is trackedNo tracking for internal users or known bots, send user ID, user properties, debug mode.
PurchaseWhen the purchase is reported (order confirmed), late purchases window, browser and server modes, wait for the browser.
Consent Mode v2Basic or advanced, default and granted states for the four consent types, regional defaults, wait_for_update, url_passthrough, ads_data_redaction.
Delivery and privacyServer events need consent, collection endpoint, send attempts, event log and retention.

Frequently asked questions

Do I need Google Tag Manager?

No. The module loads the Google tag itself from your measurement ID. If another module already loads it, the tag is shared.

Will purchases be counted twice?

No. The purchase is sent once per order; when both browser and server send it they use the same transaction_id, and the server skips orders the browser already reported unless you choose otherwise.

What does the API secret do?

It lets the server send purchases and refunds through the GA4 Measurement Protocol, so ad blockers and closed tabs do not lose orders.

Does it respect cookie consent?

Yes. Consent Mode v2 follows the Odoo cookies bar, and server events can be limited to orders whose customer accepted cookies.

How do I check that events arrive?

Turn on debug mode: events show in GA4 DebugView, in the browser console and in a panel on the page with ?ga4_debug=1. Server events can be validated with Google from the log.

Compatibility

Odoo 19

Community and Enterprise

eCommerce

website_sale

Google Analytics 4

gtag and Measurement Protocol

Consent

Google Consent Mode v2

Track your Odoo shop in GA4 the right way

Questions before you buy, help with setup, or a change for your own workflow - write to us and a developer answers.

Buy Now - $30Hire Us for Odoo Work

SUPPORT

modvantaapps@gmail.com

AUTHOR

Modvanta

INCLUDED

Module, debug panel, email support

Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • eCommerce (website_sale)
• Website (website)
• Discuss (mail)
• Invoicing (account)
Lines of code 2462
Technical Name mdv_ga4_tracking
LicenseOPL-1
Websitehttps://modvantaapps.tech/odoo-apps/ga4-tracking/
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with