Skip to content

Commit

Permalink
Merge PR #766 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 3, 2023
2 parents 199fe76 + 2115b81 commit 09ee72a
Show file tree
Hide file tree
Showing 17 changed files with 772 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/website_sale_google_tag_manager/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
105 changes: 105 additions & 0 deletions website_sale_google_tag_manager/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
=======================================
Google Tag Manager Enhanced Conversions
=======================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/15.0/website_sale_google_tag_manager
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-15-0/e-commerce-15-0-website_sale_google_tag_manager
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/e-commerce&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to configure your Odoo eCommerce to support the Google Tag Manager
Enhanced Conversions. Read more about them in this link: https://support.google.com/google-ads/answer/9888145?hl=en&ref_topic=3165803

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

#. Go to **Website > Configuration > Settings**
#. Search 'Google Tag Manager' option.
#. Fill in your 'Google Tag Manager Key' (e.g. 'GTM-ABCDEF').
#. Set 'Enhanced Conversions' on.

With it you can configure your GTM conversion scripts for ``/shop/confirmation``
with the following xpath options:

- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_email']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_name']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_street']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_city']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_zip']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_region']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_country']``

Only if you have ``partner_firstname`` installed, you can also use:

- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_firstname']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_lastname']``

Otherwise you should figure out how to split ``customer_name`` in you js tag scripts.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_google_tag_manager%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`__:

* David Vidal
* Pilar Vargas

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/15.0/website_sale_google_tag_manager>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions website_sale_google_tag_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
15 changes: 15 additions & 0 deletions website_sale_google_tag_manager/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Google Tag Manager Enhanced Conversions",
"summary": "Add support for Google Tag Manager Enhanced Conversions",
"version": "15.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"category": "eCommerce",
"website": "https://github.com/OCA/e-commerce",
"depends": ["website_sale", "website_google_tag_manager"],
"data": ["views/res_config_settings_view.xml", "views/website_templates.xml"],
"images": ["static/description/website_google_tag_manager.png"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_google_tag_manager
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_google_tag_manager
#: model:ir.model,name:website_sale_google_tag_manager.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: website_sale_google_tag_manager
#: model:ir.model.fields,field_description:website_sale_google_tag_manager.field_res_config_settings__google_tag_manager_enhanced_conversions
#: model:ir.model.fields,field_description:website_sale_google_tag_manager.field_website__google_tag_manager_enhanced_conversions
msgid "Enhanced Conversions"
msgstr ""

#. module: website_sale_google_tag_manager
#: model:ir.model.fields,help:website_sale_google_tag_manager.field_res_config_settings__google_tag_manager_enhanced_conversions
#: model:ir.model.fields,help:website_sale_google_tag_manager.field_website__google_tag_manager_enhanced_conversions
msgid ""
"This will provide the necessary data in the confirmation page that GTM needs"
" to gather in order to be able to use Enhanced Conversions. The template can"
" be edited if more info is needed in the future."
msgstr ""

#. module: website_sale_google_tag_manager
#: model:ir.model,name:website_sale_google_tag_manager.model_website
msgid "Website"
msgstr ""
2 changes: 2 additions & 0 deletions website_sale_google_tag_manager/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import website
from . import res_config_settings
11 changes: 11 additions & 0 deletions website_sale_google_tag_manager/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

google_tag_manager_enhanced_conversions = fields.Boolean(
related="website_id.google_tag_manager_enhanced_conversions", readonly=False
)
14 changes: 14 additions & 0 deletions website_sale_google_tag_manager/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models


class Website(models.Model):
_inherit = "website"

google_tag_manager_enhanced_conversions = fields.Boolean(
string="Enhanced Conversions",
help="This will provide the necessary data in the confirmation page that GTM "
"needs to gather in order to be able to use Enhanced Conversions. The "
"template can be edited if more info is needed in the future.",
)
24 changes: 24 additions & 0 deletions website_sale_google_tag_manager/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
To configure this module, you need to:

#. Go to **Website > Configuration > Settings**
#. Search 'Google Tag Manager' option.
#. Fill in your 'Google Tag Manager Key' (e.g. 'GTM-ABCDEF').
#. Set 'Enhanced Conversions' on.

With it you can configure your GTM conversion scripts for ``/shop/confirmation``
with the following xpath options:

- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_email']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_name']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_street']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_city']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_zip']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_region']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='shipping_country']``

Only if you have ``partner_firstname`` installed, you can also use:

- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_firstname']``
- ``//div[@id="gtm_enhanced_conversion_data"]/span[@name='customer_lastname']``

Otherwise you should figure out how to split ``customer_name`` in you js tag scripts.
4 changes: 4 additions & 0 deletions website_sale_google_tag_manager/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* David Vidal
* Pilar Vargas
2 changes: 2 additions & 0 deletions website_sale_google_tag_manager/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to configure your Odoo eCommerce to support the Google Tag Manager
Enhanced Conversions. Read more about them in this link: https://support.google.com/google-ads/answer/9888145?hl=en&ref_topic=3165803
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 09ee72a

Please sign in to comment.