diff --git a/google_analytics_odoo/README.rst b/google_analytics_odoo/README.rst new file mode 100755 index 000000000..83c6b267c --- /dev/null +++ b/google_analytics_odoo/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licencse-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +All In One Google Analytics +============================= +* Integrating Odoo with Google Analytics allows businesses to track user interactions and events within the Odoo application and send that data to their Google Analytics account + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Gokul P I , Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/google_analytics_odoo/__init__.py b/google_analytics_odoo/__init__.py new file mode 100644 index 000000000..9e5f5ab1d --- /dev/null +++ b/google_analytics_odoo/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/google_analytics_odoo/__manifest__.py b/google_analytics_odoo/__manifest__.py new file mode 100644 index 000000000..d4e663122 --- /dev/null +++ b/google_analytics_odoo/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "All In One Google Analytics", + 'version': '17.0.1.0.0', + 'category': 'Productivity', + 'summary': 'By connecting Google Analytics to Odoo and tracking relevant ' + 'events, you can make data-driven decisions, improve user' + 'experience, and enhance the overall performance of your ' + 'application.', + 'description': 'Integrating Odoo with Google Analytics allows businesses to' + 'track user interactions and events within the Odoo ' + 'application and send that data to their Google Analytics ' + 'account.This integration empowers businesses to improve ' + 'user experience and overall application performance.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['sale_management', 'purchase', 'account', 'website_sale'], + 'data': ['views/res_config_settings_views.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/google_analytics_odoo/controllers/__init__.py b/google_analytics_odoo/controllers/__init__.py new file mode 100644 index 000000000..03114531e --- /dev/null +++ b/google_analytics_odoo/controllers/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import checkout_payment_details +from . import login +from . import sign_up +from . import wishlist diff --git a/google_analytics_odoo/controllers/checkout_payment_details.py b/google_analytics_odoo/controllers/checkout_payment_details.py new file mode 100644 index 000000000..aca78700e --- /dev/null +++ b/google_analytics_odoo/controllers/checkout_payment_details.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import http +from odoo.addons.website_sale.controllers.main import WebsiteSale +from odoo.http import request + + +class CheckoutAndPayments(WebsiteSale): + """ Extends the functionality of the website sale process by adding + sending events to Google Analytics whe aa use checkout and do a + payment.""" + @http.route(['/shop/confirmation'], type='http', auth="public", + website=True, sitemap=False) + def shop_payment_confirmation(self, **post): + """ overriding the function to send an event when a customer do payment + in the website shop """ + sale_order_id = request.session.get('sale_last_order_id') + if sale_order_id: + order = request.env['sale.order'].sudo().browse(sale_order_id) + values = self._prepare_shop_payment_confirmation_values(order) + enable_analytics = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = request.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + products = "" + for line in order.order_line: + products += line.name + ',' + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(request.env.user.id), + "events": [{ + "name": "Online_payments", + "params": { + "Product_Name": products, + 'Customer': request.env.user.name, + "Total_Quantity": order.cart_quantity, + "Total_Price": order.amount_total, + "Total_Tax": order.amount_tax, + } + }] + } + requests.post(url, json=data) + return request.render("website_sale.confirmation", values) + else: + return request.redirect('/shop') + + @http.route('/shop/payment', type='http', auth='public', website=True, + sitemap=False) + def shop_payment(self, **post): + """Supering the function to send an event to Google Analytics when + a user checkout the products in the cart""" + res = super().shop_payment(**post) + order = request.website.sale_get_order() + enable_analytics = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = request.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + products = "" + for line in order.order_line: + products += line.name + ',' + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(request.env.user.id), + "events": [{ + "name": "Cart_Checkout", + "params": { + "Product_Name": products, + 'Customer': request.env.user.name, + "Total_Quantity": order.cart_quantity, + "Total_Price": order.amount_total, + "Total_Tax": order.amount_tax, + } + }] + } + requests.post(url, json=data) + return res diff --git a/google_analytics_odoo/controllers/login.py b/google_analytics_odoo/controllers/login.py new file mode 100644 index 000000000..8659171e7 --- /dev/null +++ b/google_analytics_odoo/controllers/login.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo.addons.web.controllers.home import Home +from odoo.http import request + + +class Login(Home): + """Extends the functionality of the web login process by adding + additional analytics tracking upon successful login.""" + def web_login(self, redirect=None, **kw): + """Controller for the web login process. + :param redirect: URL to redirect after login. + :param kw: Additional keyword arguments. + :return: Result of the web login process.""" + res = super().web_login(redirect=None, **kw) + login_success = request.params['login_success'] + if login_success: + enable_analytics = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = request.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(request.env.user.id), + "events": [{ + "name": "Login_Information", + "params": { + "User_login": kw['login'], + "Name": request.env.user.name, + "Email": request.env.user.partner_id.email, + } + }] + } + requests.post(url, json=data) + return res diff --git a/google_analytics_odoo/controllers/sign_up.py b/google_analytics_odoo/controllers/sign_up.py new file mode 100644 index 000000000..12593c332 --- /dev/null +++ b/google_analytics_odoo/controllers/sign_up.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import _ +from odoo.addons.auth_signup.controllers.main import AuthSignupHome as signup +from odoo.addons.auth_signup.models.res_users import SignupError +from odoo.http import request + + +class AnalyticsSignUp(signup): + """ + Extends the functionality of user signup process by adding + additional analytics tracking upon successful signup. + """ + def _signup_with_values(self, token, values): + """Creates a new user account with the provided values and token. + :param token: Token for user signup. + :param values: Dictionary of user data. + :raises SignupError: If authentication fails.""" + login, password = request.env['res.users'].sudo().signup(values, token) + request.env.cr.commit() # as authenticate will use its own cursor we need to commit the current transaction + pre_uid = request.session.authenticate(request.db, login, password) + if not pre_uid: + raise SignupError(_('Authentication Failed.')) + else: + enable_analytics = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(pre_uid), + "events": [{ + "name": "Signup_Information", + "params": { + "User_login": login, + "Name": request.env.user.name, + "Email": request.env.user.partner_id.email, + } + }] + } + requests.post(url, json=data) diff --git a/google_analytics_odoo/controllers/wishlist.py b/google_analytics_odoo/controllers/wishlist.py new file mode 100644 index 000000000..a20b26f00 --- /dev/null +++ b/google_analytics_odoo/controllers/wishlist.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo.addons.website_sale_wishlist.controllers.main import \ + WebsiteSaleWishlist +from odoo.http import request + + +class SaleWishlist(WebsiteSaleWishlist): + """Extends the functionality of website sale wishlist by adding + additional analytics tracking when a product is added to the wishlist. + """ + def add_to_wishlist(self, product_id, **kw): + """Function + for adding a product to the wishlist. + :param product_id: ID of the product to be added to the wishlist. + :param kw: Additional keyword arguments. + :return: Result of adding the product to the wishlist.""" + res = super().add_to_wishlist(product_id, **kw) + product = request.env['product.product'].sudo().browse(product_id) + enable_analytics = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = request.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = request.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(request.env.user.id), + "events": [{ + "name": "Add_To_Wishlist", + "params": { + "Product_Name": product.name, + "Amount": product.list_price, + 'Customer': request.env.user.name + } + }] + } + requests.post(url, json=data) + return res diff --git a/google_analytics_odoo/doc/RELEASE_NOTES.md b/google_analytics_odoo/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..25b602124 --- /dev/null +++ b/google_analytics_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 03.02.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for All In One Google Analytics diff --git a/google_analytics_odoo/models/__init__.py b/google_analytics_odoo/models/__init__.py new file mode 100644 index 000000000..79b6a56a4 --- /dev/null +++ b/google_analytics_odoo/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import account_move +from . import purchase_order +from . import res_config_settings +from . import sale_order diff --git a/google_analytics_odoo/models/account_move.py b/google_analytics_odoo/models/account_move.py new file mode 100644 index 000000000..7c82060eb --- /dev/null +++ b/google_analytics_odoo/models/account_move.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import models + + +class AccountMove(models.Model): + """Extends the class account moves by adding + additional analytics tracking upon posting an invoice.""" + _inherit = 'account.move' + + def action_post(self): + """Supering the function to send analytics data of invoice details. + :return: Result of posting the account move.""" + res = super(AccountMove, self).action_post() + enable_analytics = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(self.partner_id.id), + "events": [{ + "name": "Invoices", + "params": { + "Number": self.name, + "Customer": self.partner_id.name, + "Amount": self.amount_total, + } + }] + } + requests.post(url, json=data) + return res diff --git a/google_analytics_odoo/models/purchase_order.py b/google_analytics_odoo/models/purchase_order.py new file mode 100644 index 000000000..a7a5faa66 --- /dev/null +++ b/google_analytics_odoo/models/purchase_order.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import models + + +class PurchaseOrder(models.Model): + """Extends the class Purchase order by adding + additional analytics tracking upon posting an invoice.""" + _inherit = 'purchase.order' + + def button_confirm(self): + """Supering the function to send analytics data of the purchase order. + :return: Result of confirming the purchase order.""" + res = super().button_confirm() + enable_analytics = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(self.partner_id.id), + "events": [{ + "name": "Purchase_Order", + "params": { + "Number": self.name, + "Customer": self.partner_id.name, + "Amount": self.amount_total, + } + }] + } + requests.post(url, json=data) + return res diff --git a/google_analytics_odoo/models/res_config_settings.py b/google_analytics_odoo/models/res_config_settings.py new file mode 100755 index 000000000..f89a66af5 --- /dev/null +++ b/google_analytics_odoo/models/res_config_settings.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """This class is inheriting the model 'product.product', It contains + fields for the model. """ + _inherit = 'res.config.settings' + + measurement_id_analytics = fields.Char( + config_parameter= + 'google_analytics_odoo.measurement_id_analytics', + string='Measurement ID', + help='Measurement id of the google analytics') + api_secret = fields.Char( + config_parameter= + 'google_analytics_odoo.api_secret', + string='API Secret', + help='API secret of the google analytics') + enable_analytics = fields.Boolean(config_parameter= + 'google_analytics_odoo.enable_analytics', + string='Enable Analytics', + help='Enable to send events to' + 'google analytics') diff --git a/google_analytics_odoo/models/sale_order.py b/google_analytics_odoo/models/sale_order.py new file mode 100644 index 000000000..91f3641a2 --- /dev/null +++ b/google_analytics_odoo/models/sale_order.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import models, _ +from odoo.exceptions import UserError +from odoo.http import request + + +class SaleOrder(models.Model): + """Extends the functionality of sale orders by adding + additional analytics tracking upon confirmation and cart update.""" + _inherit = 'sale.order' + + def action_confirm(self): + """Supering the function to send analytics data of the sale order. + :return: Result of confirming the sale order.""" + res = super().action_confirm() + enable_analytics = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics') + measurement_id = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(self.partner_id.id), + "events": [{ + "name": "Sales_Order", + "params": { + "Number": self.name, + "Customer": self.partner_id.name, + "Amount": self.amount_total, + } + }] + } + requests.post(url, json=data) + return res + + def _cart_update(self, product_id, line_id=None, add_qty=0, set_qty=0, + **kwargs): + """ Updates the cart and sends analytics data. + + :param product_id: ID of the product to be updated. + :param line_id: ID of the order line. + :param add_qty: Quantity to be added. + :param set_qty: Quantity to be set. + :param kwargs: Additional keyword arguments. + :return: Result of updating the cart.""" + self.ensure_one() + self = self.with_company(self.company_id) + if self.state != 'draft': + request.session.pop('sale_order_id', None) + request.session.pop('website_sale_cart_quantity', None) + raise UserError( + _('It is forbidden to modify a sales order which is not in draft status.')) + product = self.env['product.product'].browse(product_id).exists() + if add_qty and (not product or not product._is_add_to_cart_allowed()): + raise UserError( + _("The given product does not exist therefore it cannot be added to cart.")) + if line_id is not False: + order_line = self._cart_find_product_line(product_id, line_id, + **kwargs)[:1] + else: + order_line = self.env['sale.order.line'] + try: + if add_qty: + add_qty = int(add_qty) + except ValueError: + add_qty = 1 + try: + if set_qty: + set_qty = int(set_qty) + except ValueError: + set_qty = 0 + quantity = 0 + if set_qty: + quantity = set_qty + elif add_qty is not None: + if order_line: + quantity = order_line.product_uom_qty + (add_qty or 0) + else: + quantity = add_qty or 0 + if quantity > 0: + quantity, warning = self._verify_updated_quantity( + order_line, + product_id, + quantity, + **kwargs, + ) + else: + # If the line will be removed anyway, there is no need to verify + # the requested quantity update. + warning = '' + self._remove_delivery_line() + order_line = self._cart_update_order_line(product_id, quantity, + order_line, **kwargs) + if (order_line + and order_line.price_unit == 0 + and self.website_id.prevent_zero_price_sale + and product.detailed_type not in self.env[ + 'product.template']._get_product_types_allow_zero_price() + ): + raise UserError(_( + "The given product does not have a price therefore it cannot be added to cart.", + )) + enable_analytics = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.enable_analytics'), + measurement_id = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.measurement_id_analytics') + api_secret = self.env['ir.config_parameter'].sudo().get_param( + 'google_analytics_odoo.api_secret') + if enable_analytics: + url = f"https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}" + data = { + "client_id": str(self.env.user.partner_id.id), + "events": [{ + "name": "Add_To_Cart", + "params": { + "Product_Name": order_line.name_short, + 'Customer': request.env.user.name, + "Quantity": order_line.product_qty, + "Amount": order_line.price_unit, + "Total_Price": order_line.price_total, + "Discount": order_line.discount, + "Total_Tax": order_line.price_tax, + } + }] + } + requests.post(url, json=data) + return { + 'line_id': order_line.id, + 'quantity': quantity, + 'option_ids': list(set(order_line.option_line_ids.filtered( + lambda l: l.order_id == order_line.order_id).ids)), + 'warning': warning, + } diff --git a/google_analytics_odoo/static/description/assets/icons/capture (1).png b/google_analytics_odoo/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/capture (1).png differ diff --git a/google_analytics_odoo/static/description/assets/icons/check.png b/google_analytics_odoo/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/check.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/chevron.png b/google_analytics_odoo/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/chevron.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/cogs.png b/google_analytics_odoo/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/cogs.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/consultation.png b/google_analytics_odoo/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/consultation.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/ecom-black.png b/google_analytics_odoo/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/ecom-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/education-black.png b/google_analytics_odoo/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/education-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/hotel-black.png b/google_analytics_odoo/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/hotel-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/img.png b/google_analytics_odoo/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/img.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/license.png b/google_analytics_odoo/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/license.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/lifebuoy.png b/google_analytics_odoo/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/lifebuoy.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/logo.png b/google_analytics_odoo/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/logo.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/manufacturing-black.png b/google_analytics_odoo/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/manufacturing-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/photo-capture.png b/google_analytics_odoo/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/photo-capture.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/pos-black.png b/google_analytics_odoo/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/pos-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/puzzle.png b/google_analytics_odoo/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/puzzle.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/restaurant-black.png b/google_analytics_odoo/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/restaurant-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/service-black.png b/google_analytics_odoo/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/service-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/trading-black.png b/google_analytics_odoo/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/trading-black.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/training.png b/google_analytics_odoo/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/training.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/update.png b/google_analytics_odoo/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/update.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/user.png b/google_analytics_odoo/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/user.png differ diff --git a/google_analytics_odoo/static/description/assets/icons/wrench.png b/google_analytics_odoo/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/icons/wrench.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/Cybrosys R.png b/google_analytics_odoo/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/Cybrosys R.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/categories.png b/google_analytics_odoo/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/categories.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/check-box.png b/google_analytics_odoo/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/check-box.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/compass.png b/google_analytics_odoo/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/compass.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/corporate.png b/google_analytics_odoo/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/corporate.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/customer-support.png b/google_analytics_odoo/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/customer-support.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/cybrosys-logo.png b/google_analytics_odoo/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/cybrosys-logo.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/email.svg b/google_analytics_odoo/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/features.png b/google_analytics_odoo/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/features.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/logo.png b/google_analytics_odoo/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/logo.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/phone.svg b/google_analytics_odoo/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/google_analytics_odoo/static/description/assets/misc/pictures.png b/google_analytics_odoo/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/pictures.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/pie-chart.png b/google_analytics_odoo/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/pie-chart.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/right-arrow.png b/google_analytics_odoo/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/right-arrow.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/star (1) 2.svg b/google_analytics_odoo/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/star.png b/google_analytics_odoo/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/star.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/support (1) 1.svg b/google_analytics_odoo/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/support-email.svg b/google_analytics_odoo/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/support.png b/google_analytics_odoo/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/support.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/tick-mark.svg b/google_analytics_odoo/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/whatsapp 1.svg b/google_analytics_odoo/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/misc/whatsapp.png b/google_analytics_odoo/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/misc/whatsapp.png differ diff --git a/google_analytics_odoo/static/description/assets/misc/whatsapp.svg b/google_analytics_odoo/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/google_analytics_odoo/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/google_analytics_odoo/static/description/assets/modules/1.jpg b/google_analytics_odoo/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..0edf328e5 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/1.jpg differ diff --git a/google_analytics_odoo/static/description/assets/modules/2.gif b/google_analytics_odoo/static/description/assets/modules/2.gif new file mode 100644 index 000000000..8ac32db03 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/2.gif differ diff --git a/google_analytics_odoo/static/description/assets/modules/3.jpg b/google_analytics_odoo/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..677f72279 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/3.jpg differ diff --git a/google_analytics_odoo/static/description/assets/modules/4.jpg b/google_analytics_odoo/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..1e087eed6 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/4.jpg differ diff --git a/google_analytics_odoo/static/description/assets/modules/5.jpg b/google_analytics_odoo/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..d704eb313 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/5.jpg differ diff --git a/google_analytics_odoo/static/description/assets/modules/6.jpg b/google_analytics_odoo/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..482309000 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/modules/6.jpg differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/1.png b/google_analytics_odoo/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..b9a7d56dc Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/1.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/2.png b/google_analytics_odoo/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..a26312c6b Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/2.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/3.png b/google_analytics_odoo/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..0ccaac42a Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/3.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/4.png b/google_analytics_odoo/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..60574488c Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/4.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/5.png b/google_analytics_odoo/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..61a48ad27 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/5.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/6.png b/google_analytics_odoo/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..7c7089581 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/6.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/7.png b/google_analytics_odoo/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..fb8c9d57f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/7.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/8.png b/google_analytics_odoo/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..5970d5957 Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/8.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/9.png b/google_analytics_odoo/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..930cb615f Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/9.png differ diff --git a/google_analytics_odoo/static/description/assets/screenshots/hero.gif b/google_analytics_odoo/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..dc1e254ca Binary files /dev/null and b/google_analytics_odoo/static/description/assets/screenshots/hero.gif differ diff --git a/google_analytics_odoo/static/description/banner.jpg b/google_analytics_odoo/static/description/banner.jpg new file mode 100644 index 000000000..085d88f43 Binary files /dev/null and b/google_analytics_odoo/static/description/banner.jpg differ diff --git a/google_analytics_odoo/static/description/icon.png b/google_analytics_odoo/static/description/icon.png new file mode 100644 index 000000000..1bea6ab29 Binary files /dev/null and b/google_analytics_odoo/static/description/icon.png differ diff --git a/google_analytics_odoo/static/description/index.html b/google_analytics_odoo/static/description/index.html new file mode 100755 index 000000000..90b77fd9d --- /dev/null +++ b/google_analytics_odoo/static/description/index.html @@ -0,0 +1,889 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ All In One Google Analytics

+

+ Integrating Odoo with Google Analytics allows businesses + to track user interactions and events within the Odoo +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Event Tracking: +

+

The module can + send events to Google Analytics when specific + actions occur in the Odoo backend, such as + confirming a sale order, purchase order, or + invoice. This data helps you understand how + your business processes are performing and make + data-driven decisions.

+
+
+
+
+
+
+ +
+
+

+ Payment Tracking:

+

The module can + track product payments made on your website. + This data allows you to analyze the + effectiveness of your payment methods and gain + insights into your revenue generation.

+
+
+
+
+
+
+ +
+
+

+ E-commerce Tracking:

+

For your + website, the module can track important + e-commerce actions, such as adding products to + the cart or wishlist. This data enables you to + analyze user behavior, identify popular + products, and optimize your website's user + experience.

+
+
+
+
+
+
+ +
+
+

+ Compatible with both Odoo 17.0 Community and + Enterprise Editions. +

+
+
+
+
+
+
+ +
+
+

+ User Engagement Tracking: +

+

The module + tracks user logins and sign-ups on your + website. This data provides insights into user + engagement, user acquisition, and helps you + understand your customer base better.

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

+ First go to Google + Analytics --> ADMIN --> Data Streams +

+
+
+
+
+
+
+ +
+
+

+ Then select Add stream -->Web +

+
+
+
+
+
+
+ +
+
+

+ Then add the valid Website URL (odoo + instance) and Stream name and Create + stream. +

+
+
+
+
+
+
+ +
+
+

+ After that you can see your stream in data + stream and copy the 'MEASUREMENT ID' from + there. +

+
+
+
+
+
+
+ +
+
+

+ After that you can create API secret in + 'Measurement Protocol API secrets' option. +

+
+
+
+
+
+
+ +
+
+

+ Create the API secret and copy the 'Secret + value' from there +

+
+
+
+
+
+
+ +
+
+

+ After that install our module and Goto the + Settings of your odoo instance and enable + the 'Enable Analytics' then you can set the + 'Measurement ID' and 'API Secret' +

+
+
+
+
+
+
+ +
+
+

+ After that you can track various user + interactions + within the Odoo backend,such as + + confirming + sales orders, purchase orders, or + invoices,as well as actions on the + website like adding products to the + cart, wishlists,and completing cart + checkout and payment process. + Additionally, user logins and sign-ups + can also be monitored. + + These events are observable in real-time + through Google Analytics. To access this + feature, navigate to Reports and select + Realtime, as depicted in the image above. +

+
+
+
+
+
+
+ +
+
+

+ You can also access detailed information + about these events through Google + Analytics, presented in both graph and + table formats. Over time, you can filter + these events by date and customize the + report according to your preferences. To + access this detailed information, navigate + to Reports, then select Engagement, and + finally Events, as demonstrated in the + example image above. +

+
+
+
+ +
+ + +
+
+
    +
  • + Google + Analytics Allows You To Track User Interactions + And Events Within Your Odoo Application And + Send That Data To Your Google Analytics Account + For Analysis +
  • +
  • + By leveraging + this module, businesses can gain valuable + insights into user behavior, optimize + processes, and improve the overall website + experience. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:3rd Feb 2024 +
+

+ Initial Commit for All In One Google Analytics +

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce + & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/google_analytics_odoo/views/res_config_settings_views.xml b/google_analytics_odoo/views/res_config_settings_views.xml new file mode 100755 index 000000000..09f4279b9 --- /dev/null +++ b/google_analytics_odoo/views/res_config_settings_views.xml @@ -0,0 +1,53 @@ + + + + + + res.config.settings.view.form.inherit.google.analytics.odoo + + res.config.settings + + + + +

Google Analytics

+
+ +
+
+
+
+