Overview
The Odoo Google Analytics 4 eCommerce module simplifies and automates the integration between your Odoo eCommerce website and Google Analytics. The solution accurately sends all key eCommerce events, from product views and add-to-cart actions to successful purchases and payments. As a result, businesses receive a ready-to-use sales monitoring tool without the need to configure complex tracking code on the website manually.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
|---|---|
| Compatibility |
Community
Enterprise
|
| Technical Name | website_sale_google_analytics_4 |
| Version | 19.0.1.1.0 |
| License | OPL-1 |
| Category | |
| Support | Free 60 days support and 360 days bug-fixing |
Use Case
Jorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Forem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Dorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.
It is a long established fact that a reader will be distracted by the readable content of a page
Korem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Korem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.
Odoo App Installation
Upload modules
Upload modules from the ZIP archive to your Odoo hosting, or a GitHub repository connected there.
Place the unzipped modules in your custom add-on directory and restart the Odoo system service.
Update App List
After restarting, activate the Developer Mode, and go to the Apps menu.
Click on Update Apps List to fetch the new modules in the list.
Activate the App
Install the new module, finding it by name and clicking on the Activate button.
* If you don't see the module, try to remove the default Apps filter from the search bar.
Configuration
Follow the instructions in the module description to complete the installation process and start using the app.
Manual
Activation
After installing the app, go to the website settings and, in the Enhanced Website Tracking section, enable the Activate Tracking option. To test your website tracking and view tracked events in the browser console, also temporarily activate the Debug Logging feature:
Cookie Consent
The solution is compatible with the Odoo Google Consent Mode module, which allows managing cookie consent and updating consent states by sending them to Google.
Tracking Service Configuration
Adding a Tracking Service
Go to the Website - Configuration - Tracking - Services menu and click New to add a new tracking service for your Odoo website:
Firstly, fill in the following fields in the new tracking service:
- Specify a Website (if multiple websites are used)
- Select the service Type as Google Analytics 4
- Paste your GA4 Measurement ID into the Key field
Then, specify the type of identifier for the products and which product category is provided to Google:
If products have attributes and variants, choose Product Variant ID in the Item Type field; if not, select Product Template ID.
Select the desired Category Type: an eCommerce Public Category or an internal Product Category.
The next option is the Lead Value on the Options tab:
It is the monetary value of the Lead Generation event and should be set based on your estimate.
Tracking Logs
The solution includes an internal logging feature. To activate it, enable the Internal Logs option:
To view logs, go to the Website - Configuration - Tracking - Logs menu or click the Logs button at the top of the form:
The list of internal tracking events:
User-provided Data
Enhanced conversions help optimize your advertisements by providing Google with additional user data. Open the Advanced Matching tab and click Allow Enhanced Conversions, which enables all available options for this tracking service:
Review the options and leave enabled the user-provided data that should be sent to Google.
Use the Sale Order Partner value as the Customer Data Source because it provides more user information when guest checkouts are allowed without registration:
Advanced Settings
The solution includes additional settings available in Developer Mode.
Product Identifier
The solution uses the Product ID field as the unique product identifier. If another value should be used, open the Technical tab and specify a different product field containing the required identifier:
Purchase on Portal
To track purchases on the portal, enable the Track Purchase on Portal option:
Exclude Delivery
The next setting available for tracking services is Exclude Delivery. When this option is enabled, delivery lines from sales orders are not included in tracking data and are not sent through the service:
Exclude Rewards
To exclude reward order lines from tracking data, enable the Exclude Reward option:
Add to Cart
By default, the module tracks the actual addition of a product to the cart. If tracking should occur immediately after clicking the button, without waiting for the product to be actually added to the cart, complete the following steps:
- Open the Website — Configuration — Websites menu
- Open the website on the Enhanced Tracking tab
- Enable the Add to Cart on Click option
Purchase
To track purchases only after a successful payment transaction, enable the Track Confirmed Purchases only option:
If, according to your business logic, an order with the Pending payment status should also be considered a purchase, additionally enable the Track Pending Purchases too option.
Google First-party Mode
Google First-party Mode allows configuring Google tags on your Odoo website to load scripts from your tagging servers or CDN instead of Google's:
The app allows specifying a custom URL for Google Tag Serving. Open the website settings and, in the Tracking and SEO section, change the Tag Serving URL:
After saving the settings, sign out of Odoo and open the page source of your website to review the result:
To restore the default Google tag URL, click the button on the right:
Testing
To test your Google Analytics 4 script, use the Debug Mode feature. Enable this option in your GA4 tracking service options:
Now open Google Analytics 4, go to the Admin menu, and in the Data display section, open DebugView. All tracking events from your website appear in this window in near real time:
Changelog
14.0.2.2.0 2024-03-19
- Add compatibility with the Google Consent Mode module.
14.0.2.1.0 2024-02-06
- Improve the GA4 identifier generation.
14.0.2.0.1 2023-08-05
- Fix inheritance of the method "get_data_for_purchase".
14.0.2.0.0 2023-06-15
14.0.1.5.4 2023-02-03
- Fix the GA4 event parameter.
14.0.1.5.3 2022-12-07
- Add ability to skip some products.
14.0.1.5.2 2022-11-02
- Improve "purchase" event.
- Improve GA4 user reference generation.
14.0.1.5.1 2022-10-18
- Add gtag.js params method.
14.0.1.5.0 2022-10-12
- Add ability to specify the GA4 config ID.
- Fix the "purchase" event data.
14.0.1.4.0 2022-09-15
- Add Google Analytics User ID Feature.
14.0.1.3.0 2022-09-02
- Add the "add_payment_info" event.
- Add the "add_shipping_info" event.
14.0.1.2.0 2022-08-24
- Move the "add_to_cart" logic to JS.
14.0.1.1.0 2022-08-13
- Improve script running when webpage is loaded.
- Improve the "add_to_cart" event firing logic.
14.0.1.0.2 2022-08-12
- Improve multiply "onclick" element adding.
14.0.1.0.1 2022-07-29
- Fix the "AddToCart" event function for logged users.
14.0.1.0.0 2021-06-03
- Init version.
15.0.3.3.0 2024-04-04
- Implement Google Consent Mode compatibility.
- Add a compatibility for Google Tag scripts.
15.0.3.2.1 2024-03-19
- Fix templates naming.
15.0.3.2.0 2024-03-18
- Add compatibility with the Google Consent Mode module.
15.0.3.1.0 2024-02-07
- Improve the GA4 identifier generation.
- Make a lead value common for the service.
15.0.3.0.1 2023-08-05
- Fix inheritance of the method "get_data_for_purchase".
15.0.3.0.0 2023-07-27
- Implement a new generation of website tracking logic.
15.0.2.1.3 2023-02-03
- Fix the GA4 event parameter.
15.0.2.1.2 2022-11-11
- Refactoring GA4 user reference method.
15.0.2.1.1 2022-11-03
- Improve the method to get GA4 data.
15.0.2.1.0 2022-09-15
- Add Google Analytics User ID Feature.
15.0.2.0.0 2022-09-08
- Extend the standard e-commerce tracking logic.
- Add product category type selection.
15.0.1.0.1 2022-06-02
- Fix the "AddToCart" event function for logged users.
15.0.1.0.0 2022-02-05
- Migrate from 14.0
16.0.2.4.3 2024-10-23
- Improve the logic to check available user tracking fields to activate.
16.0.2.4.2 2024-10-18
- Add an option to hash the "Street" user data.
- Refactor a logic to check available user tracking fields to activate.
16.0.2.4.1 2024-07-20
- Add the "First Name" and "Last Name" to a user data enhanced matching.
16.0.2.4.0 2024-07-17
- Add compatibility for enhanced conversions.
- Improve an user data processing.
16.0.2.3.1 2024-04-04
- Improve the Google consent calls for different Google Tags.
16.0.2.3.0 2024-04-02
- Implement Google Consent Mode compatibility.
- Add a compatibility for Google Tag scripts.
16.0.2.2.1 2024-02-24
- Improve getting product data from the product list.
16.0.2.2.0 2024-02-10
- Implement integration with the standard Odoo Cookies Bar.
- Implement the Google cookie consent management.
16.0.2.1.2 2024-02-10
- Improve the GA4 identifier generation.
- Fix inheritance for the "get_data_for_purchase" method.
16.0.2.1.1 2023-12-22
- Add README.rst.
- Fix linter warnings.
16.0.2.1.0 2023-11-15
- Remove the field "GA4 Lead Value" and start using the base field "Lead Value".
16.0.2.0.0 2023-07-27
- Implement a new generation of website tracking logic.
16.0.1.2.0 2023-04-07
- Improve the GA4 param "price" for product prices with discounts
16.0.1.1.1 2023-02-03
- Fix the GA4 event parameter.
16.0.1.1.0 2023-01-14
- Improve firing logic of the events "begin_checkout", "add_shipping_info", "add_payment_info".
16.0.1.0.0 2022-11-11
- Migration from 15.0.
17.0.1.3.7 2026-05-25
- Improve getting of the list of allowed settings for user data.
- Refactor methods to process order and product data.
17.0.1.3.6 2025-10-03
- Improve the Lead tracking data.
17.0.1.3.5 2024-10-23
- Improve the logic to check available user tracking fields to activate.
- Add an option to hash the "Street" user data.
17.0.1.3.4 2024-08-30
- Add the "First Name" and "Last Name" to a user data enhanced matching.
17.0.1.3.3 2024-08-20
- Add the "currency" param to the top level of tracking data.
17.0.1.3.2 2024-07-17
- Improve the enhanced conversions logic.
- Improve views.
17.0.1.3.1 2024-07-05
- Fix the "GA4 Debug Mode" option visibility.
17.0.1.3.0 2024-06-20
- Add compatibility for enhanced conversions.
- Improve an user data processing.
17.0.1.2.0 2024-04-09
- Implement Google Consent Mode compatibility.
- Add a compatibility for Google Tag scripts.
17.0.1.1.0 2024-02-24
17.0.1.0.1 2024-02-10
- Fix the method "get_data_for_purchase" inheritance.
- Fix generating of GA4 external IDs for portal users.
17.0.1.0.0 2023-11-03
- Migration from 16.0.
18.0.1.2.7 2026-05-25
- Improve getting of the list of allowed settings for user data.
- Refactor methods to process order and product data.
18.0.1.2.6 2026-04-20
- Implement option to skip reward lines when preparing tracking data from sale order.
18.0.1.2.5 2026-01-07
- Add the "shipping" tracking parameter for the Purchase event.
18.0.1.2.4 2025-11-19
- Improve the Google Tag serving URL logic for multiple company environment.
18.0.1.2.3 2025-10-12
- Implement the option to exclude from tracking delivery lines from sale orders.
- Add tracking for the Remove from Cart event.
18.0.1.2.2 2025-10-08
- Implement the option to specify different product identifiers instead of the product "id".
18.0.1.2.1 2025-10-03
- Fix view inheritance.
18.0.1.2.0 2025-05-29
- Implement the Google First-party Mode to modify the serving URL and load Google scripts from own servers.
18.0.1.1.0 2025-01-14
- Improve the logic to check available user tracking fields to activate.
- Add an option to hash the "Street" user data.
18.0.1.0.0 2024-10-11
- Migration from 17.0.
19.0.1.1.0 2026-05-21
- Implement user-provided data collection for the first-party GA4 data.
- Add the "view_cart" tracking event.
19.0.1.0.5 2026-04-20
- Add option to skip reward lines when preparing tracking data from sale order.
19.0.1.0.4 2026-02-18
- Fix string value formatting.
19.0.1.0.3 2026-02-03
- Add the "shipping" tracking parameter for the Purchase event.
- Improve the Google Tag serving URL logic for multiple company environment.
19.0.1.0.2 2025-12-29
- Add method to get a list of allowed settings for Google user data.
19.0.1.0.1 2025-10-15
19.0.1.0.0 2025-10-11
- Migration from 18.0.
Resources
How to configure Google First-party mode in Odoo with Cloudflare
How to Configure User-Provided Data Collection in GA4