Google Tag Manager (GTM) eCommerce dataLayer | GTM Server Side, Enhanced Conversions, Google Consent Mode v2
by Modvanta https://modvantaapps.tech/odoo-apps/google-tag-manager/$ 29.91

Google Tag Manager for Odoo eCommerce - a clean GA4 ecommerce dataLayer on every page
Load your GTM container on every page of the Odoo website and push GA4 ecommerce events with full items to the dataLayer - from product lists to the purchase, once per order - with server-side tagging, hashed user data and Google Consent Mode v2 on the Odoo cookies bar.
Written and supported by Modvanta - modvantaapps@gmail.com
What it does
Enter your container ID and the module loads Google Tag Manager on every page. It pushes GA4-named events to the dataLayer: 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, purchase, login, sign_up and generate_lead, plus odoo.page on every page. Items carry id, name, price and quantity, and the purchase is pushed once per order.
The container can load from your own domain through a tagging server URL and tag serving path (server-side tagging), and Tag Manager environment parameters can be set for staging websites. Optionally a hashed user ID and user-provided data on purchase are added for enhanced conversions, and Odoo's own Google Analytics tag can be replaced.
Google Consent Mode v2 follows the Odoo cookies bar in basic or advanced mode with default states per consent type. A debug mode writes every push to a panel on the page, and an event log in Odoo keeps the pushed events with value, currency, consent and page.
Who it is for
Shops that manage tags in GTM Get a GA4 ecommerce dataLayer your GTM tags can use, without writing JavaScript in Odoo. | Marketing teams Fire GA4, Google Ads and other tags from one container on the same events. | Stores using server-side tagging Load the container from your own tagging server. |
Key features
Every screen below is the module running on Odoo 19 with a placeholder container ID (GTM-DEMO123); requests to Google were blocked on the bench, the debug panel and event log show what was pushed.
Feature 1
Container and dataLayer settings
Container ID, replace Odoo's Google Analytics tag, Odoo cookies bar, item_id source, hashed user ID, user-provided data on purchase, who gets the container, debug mode, event log, when the purchase is pushed and events not to push. The list of pushed events is shown under the settings.

Feature 2
Consent Mode v2
Basic (container only after consent) or advanced (container at once, tags follow the consent state), Consent Mode v2 commands, default states for ad_storage, ad_user_data, ad_personalization and analytics_storage, behaviour without a cookies bar, wait_for_update, url_passthrough and ads_data_redaction.

Feature 3
Server-side tagging and environments
Load the container from your own domain with a tagging server URL and tag serving path, and set Tag Manager environment parameters for staging websites.

Feature 4
Product list, consent banner and debug panel
The shop page pushes view_item_list with its items while the Odoo cookies bar asks for consent; the debug panel lists every push on the page.

Feature 5
view_item and add_to_cart
On the product page view_item is pushed, and adding to the cart pushes add_to_cart with the item.

Feature 6
view_cart
The cart page pushes view_cart with its lines.

Feature 7
Event log in Odoo
Every pushed event with website, event name, transaction id, value, currency, consent state and page.

How it works, step by step
| 1 | Install and enter the container ID Website -> Configuration -> Google Tag Manager: switch it on and enter GTM-... |
| 2 | Choose consent and data options Pick the Consent Mode v2 mode and defaults, user data and item_id. |
| 3 | Build your tags in GTM Use the GA4 ecommerce events in the dataLayer as triggers for your GA4, Google Ads or other tags. |
| 4 | Check with debug mode Open the site with ?gtm_debug=1 to see every push in a panel, and look at the event log. |
| 5 | Optional: server-side Enter your tagging server URL and serving path to load the container from your own domain. |
Settings
All settings are per website, on its Google Tag Manager form.
| Container | Enable, container ID, replace Odoo's Google Analytics tag, Odoo cookies bar. |
| Items and users | item_id source, hashed user ID, user-provided data on purchase. |
| Who gets the container | No container for internal users or known bots, debug mode, event log and retention. |
| Purchase | When the purchase is pushed, late purchases window, events not pushed. |
| Consent Mode v2 | Basic or advanced, Consent Mode v2 commands, default and granted states, regional defaults, wait_for_update, url_passthrough, ads_data_redaction. |
| Server-side and environments | Tagging server URL, tag serving path, environment parameters. |
Frequently asked questions
Do I still need to write code?
No. The module loads the container and pushes the events; you build the tags and triggers in Google Tag Manager.
Which events are pushed?
GA4 ecommerce events from product list to purchase, plus login, sign_up, generate_lead and odoo.page.
Is the purchase pushed twice on reload?
No. The purchase is pushed once per order.
Does it support server-side tagging?
Yes. Enter the tagging server URL and serving path to load the container from your own domain.
How do I see what is pushed?
Turn on debug mode and open the site with ?gtm_debug=1; the event log in Odoo keeps the pushed events too.
Compatibility
Odoo 19 Community and Enterprise | eCommerce website_sale | Google Tag Manager web and server containers | Consent Google Consent Mode v2 |
Give your GTM container the Odoo data it needs
Questions before you buy, help with setup, or a change for your own workflow - write to us and a developer answers.
SUPPORT | AUTHOR Modvanta | INCLUDED Module, debug panel, event log, email support |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Website (website) • Discuss (mail) • Invoicing (account) |
| Lines of code | 1873 |
| Technical Name |
mdv_google_tag_manager |
| License | OPL-1 |
| Website | https://modvantaapps.tech/odoo-apps/google-tag-manager/ |
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