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. Google Tag Manager and GTM Data Layer: GA4 ecommerce events for the shop v 20.0
  4. Sales Conditions FAQ

Google Tag Manager and GTM Data Layer: GA4 ecommerce events for the shop

by Aerya IT Solutions https://aerya.net
Odoo

$ 43.83

v 20.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Versions 17.0 18.0 19.0 20.0
You bought this module and need support? Click here!
Versions 17.0 18.0 19.0 20.0
  • Description
  • Manifest
  • License
Aerya Odoo 17, 18, 19 and 20, Community and Enterprise · Developed in the European Union by Aerya IT Solutions

Google Tag Manager and GTM Data Layer: GA4 ecommerce events for the shop

Add your Google Tag Manager container to every Odoo website and fill the data layer with the shop events of the GA4 e-commerce schema: product lists, product pages, cart, checkout, and one purchase per order. Consent Mode v2 is set before the container loads. The module only writes to the page in the visitor's browser and makes no call to Google.

One GTM container per website, snippet and noscript added for you
purchase is sent once per order, never again on a reload
Consent Mode v2 default before the container, update on the visitor's choice

This module is a technical tool. The shop owner stays the controller: you sign the vendors' terms and you have the cookie banner text and the privacy policy checked by a lawyer. The screenshots use a fictitious furniture shop and invented customers.

Runs on Odoo.sh and on-premise, not on Odoo Online (SaaS), where Odoo does not allow modules with Python code. Please buy the version that matches your database.

The data layer of an order confirmation page

The data layer of an order confirmation page. Screenshots of Odoo 19, valid for Odoo 20.

53 automated tests
in Odoo 20, with browser tests that read window.dataLayer
Code checked with flake8 and pylint-odoo
no warnings
Odoo core modules only
Community and Enterprise

What reaches the data layer

Events follow the GA4 e-commerce schema, so the standard GA4 tags and triggers of Tag Manager work with them.

EventWhen it is pushed
view_item_listA shop page, a category or a search result
view_itemA product page
add_to_cart, remove_from_cartThe cart changes
view_cartThe cart page
begin_checkoutThe checkout, once per cart
add_shipping_info, add_payment_infoThe payment page
purchaseThe confirmation page, once per order
sign_up, generate_leadA new account, a submitted website form

A container per website, in the website settings

Enter GTM-XXXXXXX on the website. The container script goes in the head and the noscript frame at the start of the body. A value that does not start with GTM- is refused when you save.

Leave out the internal users and the website editor, so your own clicks do not count as visits.

The Tag Manager settings of a website

The GA4 e-commerce events, ready in the data layer

view_item_list and view_item on the shop pages; add_to_cart and remove_from_cart when the cart changes; view_cart, begin_checkout, add_shipping_info and add_payment_info through the checkout.

sign_up after a new account and generate_lead after a website form. Each event carries items with an id, name, price, quantity, category and variant.

A shop page and the view_item_list event it pushed

The product page and the cart

The item id is the internal reference, or the variant id: your choice. Prices are sent with or without tax, as you set it, in the currency of the pricelist the visitor sees.

Adding and removing a product is seen on the cart as well as on a page that reloads after the change.

The cart page with its add_to_cart and view_cart entries

One purchase per order

The purchase event carries the order number, the value after discounts, tax, shipping, currency and the items. It is sent only for a confirmed order or one with a payment pending or done.

Odoo remembers which orders were sent, and the browser too, so a reload or a return to the confirmation page adds nothing.

The purchase event of a confirmation page, read from window.dataLayer

Consent Mode v2 around the container

A consent default with every signal denied is written before the container script. When the visitor chooses, a consent update follows. The choice comes from the Aerya consent module if it is installed, otherwise from Odoo's cookie bar.

The cookie bar and the consent entries of the data layer

Screenshots of Odoo 19, valid for Odoo 20.

Next to Odoo's own Google setting

One container, counted once.

If the Google analytics key of the Odoo website settings is also set, the module does not load a second container and the settings page says so, so nothing is counted twice. Use it next to the Aerya cookie banner or Odoo's own cookie bar.

Everything included

One container per website

GTM-XXXXXXX in the website settings, checked on save.

GA4 e-commerce events

Lists, items, cart, checkout, purchase, sign-up and lead.

Purchase once

Kept in Odoo and in the browser: a reload sends nothing.

Tax and currency

Prices with or without tax, in the pricelist currency.

Item ids

The internal reference or the variant id.

Consent Mode v2

Default denied first, update on the visitor's choice.

Leave out staff

Internal users and the editor are not tracked.

Several websites

Every setting is per website.

How it works

1

Install the module and open Website, Configuration, Tag Manager.

2

Enter the container ID and choose tax, id and staff options.

3

Open the shop and read window.dataLayer in the browser.

4

Publish the container in Tag Manager with your GA4 tags.

Compatibility

VersionsOdoo 17, 18, 19 and 20
EditionsCommunity and Enterprise
ModulesWebsite; Website Sale for the shop events
ServicesGoogle Tag Manager, GA4 e-commerce schema
LanguagesEnglish, German, French, Spanish, Dutch, Romanian

What stops it, and what it does not do

Stops with a message: a container ID that does not start with GTM-. A purchase is not sent for an order with no confirmed or pending payment.

Not included: server-side tagging, sending events from the server, and per-variant events when the visitor changes an option on the product page. The module does not claim that a website complies with a law.

Explore our other apps

More modules by Aerya IT Solutions for Odoo 20, built to work together.

Variant Order Grid for eCommerce

Customers order several variants at once from an order grid on the product page

65 EUR · View on the store →

Shop Blocks for eCommerce

Shop blocks for the website editor: Shop Benefits

55 EUR · View on the store →

Shop Effects for eCommerce

Effects for the shop, set in the website editor: product card hover (lift, glow, 3D tilt

65 EUR · View on the store →

Signup Approval, Händlerfreischaltung und

Customer registration approval, B2B registration approval

29 EUR · View on the store →

Call for Price, Preis auf Anfrage, Angebot anfordern im

Call for price and price on request in the web shop

25 EUR · View on the store →

Double Opt-In, E-Mail-Bestätigung bei der Registrierung

Signup email verification and email verification before the first login

19 EUR · View on the store →

Questions or a custom quote?

Write to info@aerya.ro for questions about the module, its installation or custom development.

Aerya

Developed in the European Union by Aerya IT Solutions, Odoo implementation and development. aerya.net

Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Website (website)
• Discuss (mail)
Lines of code 1043
Technical Name aerya_website_gtm
LicenseOPL-1
Websitehttps://aerya.net
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