Overview
The Google Analytics Measurement Protocol app connects your Odoo website to Google Analytics through server-side integration, providing enhanced tracking data for more accurate analytics.
Find out more about the Google Analytics Measurement Protocol: https://developers.google.com/analytics/devguides/collection/protocol/ga4
| Availability |
Odoo Online
Odoo.sh
On Premise
|
|---|---|
| Compatibility |
Community
Enterprise
|
| Technical Name | website_sale_google_analytics_api |
| Version | 19.0.1.0.3 |
| 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 module is compatible with the Odoo Google Consent Mode solution, which allows managing cookie consent and updating consent states by sending them to Google.
Configuration
The module allows you to track e-commerce events on your website and send them to Google along with product information and user-provided data. You can send this data via Google Tag and via API. These features are implemented at the tracking service level. Add and configure a tracking service for your Odoo website.
Adding a Tracking Service
Go to the Website - Configuration - Tracking - Services menu and click New to add a new tracking service.
Firstly, fill in the following fields in the new tracking service:
- Specify a Website (if using multiple websites)
- Select Google Analytics 4 as the service Type
- Paste your GA4 Measurement ID into the Key field
Then, specify the type of product identifier and product category sent to Google.
If products have attributes and variants, choose Product Variant ID in the Item Type field; otherwise, 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.
This field represents the monetary value of a lead generation, based on estimated evaluations.
Measurement Protocol Activation
Enable the Internal Logs option.
After that, switch on the API mode by enabling the Activate option in the API section.
Next, log in to your Google Analytics account and create an Access Token under Web stream details, Events section, and Measurement Protocol API secrets.
Copy the Secret value and paste it into the Access Token field in Odoo.
Sending Tracking Data
Internal logs record visitor actions on your Odoo website to assist with further analysis and monitoring. Click the Logs button at the top of the form.
Enable the State and API Sent Date columns to display a status and the date of event sending through the Measurement Protocol:
Scheduled Actions
The module uses a scheduled action to send tracking events periodically. By default, this action runs every 30 minutes, but you can adjust this interval to meet your requirements.
To send tracking data manually, select tracking logs from the list or open a log and click on Send Event.
Sensitive Data Cleanup
Because tracking logs may contain sensitive data, configure a cleanup schedule. Go to the website settings and set the cleaning period. The default period is 30 days.
Enable the Unlink Logs After Period option to completely remove tracking logs older than the specified period.
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 module includes additional settings available in Developer Mode.
Product Identifier
The module uses the Product ID field as a unique product identifier. To use a different value, specify another product field containing the desired identifier on the Technical tab:
Purchase on Portal
To track portal purchases, enable the Track Purchase on Portal option:
Exclude Delivery
The next available setting for tracking services is Exclude Delivery. When enabled, the service excludes delivery lines from sales orders in tracking data transmissions:
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. To track the event upon clicking the button without waiting for the actual addition to the cart, perform the following steps:
- Navigate to Website — Configuration — Websites
- 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 business logic considers an order with a Pending payment status as a purchase, enable the Track Pending Purchases too option as well.
Testing
Test the Google Analytics Measurement Protocol integration to ensure accurate event tracking.
Two verification methods are available:
- Realtime Overview — monitor live events directly within the Google Analytics user interface
- Debug Mode — validate payloads using the Measurement Protocol validation server
Realtime Overview
The first way to test the Google Analytics Measurement Protocol integration is to use the Realtime Overview. Enable the Remove JS Script option to prevent events from being sent to Google Analytics via script before the API.
Once the state of internal logs sending has changed to Sent, go to Google Analytics, then open the Reports menu and the Realtime Overview page.
Review the Event count by Event name and Key events by Event name sections, which should contain the events you sent.
Measurement Protocol Validation Server
To verify the integration with the Measurement Protocol validation server, enable the Debug Mode option in your Google Analytics tracking service settings.
Open one of the events and send it manually. If the log status has changed to Debug and on the Technical tab, the API Response field has the OK value, which means that no errors were found.
If the status changed to Warning or Error, check the API Response field for details on why.
After completing testing, disable Debug Mode and send the event again. The Sent status means that the event was successfully sent via API to Google Analytics.
Changelog
17.0.1.0.2 2026-05-25
- Improve getting of the list of allowed settings for user data.
17.0.1.0.1 2026-04-20
- Improve parsing of Google Analytics session reference from cookies.
17.0.1.0.0 2024-09-05
- Init version.
16.0.1.0.1 2024-10-23
- Improve the logic to check available user tracking fields to activate.
16.0.1.0.0 2024-10-18
- Init version.
18.0.1.1.2 2026-05-25
- Improve getting of the list of allowed settings for user data.
18.0.1.1.1 2026-04-20
- Improve parsing of Google Analytics session reference from cookies.
18.0.1.1.0 2025-10-12
- Decrease the price.
- Improve demo data.
18.0.1.0.0 2025-01-14
- Migration from 17.0.
19.0.1.0.3 2026-05-25
- Add handling of event validation response data.
- Add demo data.
19.0.1.0.2 2026-04-20
- Improve parsing of Google Analytics session reference from cookies.
19.0.1.0.1 2025-12-29
- Improve getting of the list of allowed settings for user data.
19.0.1.0.0 2025-10-12
- Migration from 18.0.
Resources
How to configure Google First-party mode in Odoo with Cloudflare