Skip to content

Commit

Permalink
[16.0][ADD] website_analytics_umami
Browse files Browse the repository at this point in the history
[16.0][FIX] pre-commit / pre-commit (pull_request) fixes

[16.0][FIX] hook id: black fixes

[16.0][FIX] capitalized module name

[16.0][FIX] symlink added
  • Loading branch information
yibudak committed Apr 26, 2023
1 parent 77b033d commit 4f4acb6
Show file tree
Hide file tree
Showing 20 changed files with 958 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/website_analytics_umami/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,
)
98 changes: 98 additions & 0 deletions website_analytics_umami/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
===============
Umami Analytics
===============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/16.0/website_analytics_umami
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-16-0/website-16-0-website_analytics_umami
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/186/16.0
:alt: Try me on Runbot

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

This module allows to simply configure your odoo website for using Umami_ which is open source, privacy-focused
alternative to Google Analytics.

.. _Umami: https://umami.is/

**Table of contents**

.. contents::
:local:

Usage
=====

To configure this module, you need to:

* Go to Settings/Website
* Enable `Umami Analytics`
* Fill in `Umami Website ID` and `Umami host`
* Take care that you fill in the correct value for `Umami host`, it should be
without the protocol (http/https) and without the trailing slash.

Fields Example:

The original Umami tracking code is:

`<script async defer data-website-id="512c723a-a19d-4b71-614f-4d32c1d50fdf" src="https://example.org/umami.js"></script>`

* `Umami Website ID` is `512c723a-a19d-4b71-614f-4d32c1d50fdf`
* `Umami host` is `example.org`
* `Umami Script Name (optional)` is `umami.js` (default value)

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/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/website/issues/new?body=module:%20website_analytics_umami%0Aversion:%2016.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
~~~~~~~

* Yigit Budak
* Therp BV

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

* Yigit Budak <[email protected]>

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/website <https://github.com/OCA/website/tree/16.0/website_analytics_umami>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions website_analytics_umami/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2022 Yiğit Budak (https://github.com/yibudak)
# Copyright 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
19 changes: 19 additions & 0 deletions website_analytics_umami/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Yiğit Budak (https://github.com/yibudak)
# Copyright 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Umami Analytics",
"version": "16.0.1.0.0",
"author": "Yigit Budak, Therp BV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"license": "AGPL-3",
"category": "Website",
"summary": "Privacy-focused web analytics with Umami",
"depends": ["website"],
"data": [
"views/website_config_settings.xml",
"views/website.xml",
"views/templates.xml",
],
"installable": True,
}
88 changes: 88 additions & 0 deletions website_analytics_umami/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_analytics_umami
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-28 12:58+0000\n"
"PO-Revision-Date: 2022-10-28 12:58+0000\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_analytics_umami
#: model:ir.model,name:website_analytics_umami.model_res_config_settings
msgid "Config Settings"
msgstr "Yapılandırma Ayarları"

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_config_settings_umami
msgid "Privacy-focused visitor analytics with Umami."
msgstr "Umami ile gizlilik odaklı ziyaretçi analizi."

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_analytics_host
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_analytics_host
msgid ""
"The host/path your Umami instance is accessible by on the internet. Do not include a protocol here!\n"
"So http[s]://[this field]/umami.js should resolve to your umami.js"
msgstr "Umami kurulumunuzun yapıldığı sunucu domaini. Bağlantı protokolünü (http/https) yazmayınız, örnek: example.org"

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_script_name
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_script_name
msgid ""
"The name of the script to load. Defaults to umami.js You can leave it as is "
"unless you have a custom script"
msgstr "Umami scriptinin adı. Varsayılan olarak umami.js olarak ayarlanmıştır. Özel bir script kullanıyorsanız değiştirebilirsiniz."

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_analytics_id
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_analytics_id
msgid "The unique Umami ID uses to identify the website"
msgstr "Websiteniz için kullanılacak Umami ID'si"

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__has_umami_analytics
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__has_umami_analytics
msgid "Umami Analytics"
msgstr "Umami Analitik"

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_form
msgid "Umami Conf."
msgstr "Umami Ayarları"

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_analytics_host
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_analytics_host
msgid "Umami Host"
msgstr "Umami Sunucusu"

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_script_name
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_script_name
msgid "Script Name"
msgstr "Script Adı"

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_analytics_id
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_analytics_id
msgid "Umami Website ID"
msgstr "Umami Web Sitesi ID'si"

#. module: website_analytics_umami
#: model:ir.model,name:website_analytics_umami.model_website
msgid "Website"
msgstr "Websitesi"

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_config_settings_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_form
msgid "umami.is"
msgstr "umami.is"
88 changes: 88 additions & 0 deletions website_analytics_umami/i18n/website_analytics_umami.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_analytics_umami
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-28 12:57+0000\n"
"PO-Revision-Date: 2022-10-28 12:57+0000\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_analytics_umami
#: model:ir.model,name:website_analytics_umami.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_config_settings_umami
msgid "Privacy-focused visitor analytics with Umami."
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_analytics_host
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_analytics_host
msgid ""
"The host/path your Umami instance is accessible by on the internet. Do not include a protocol here!\n"
"So http[s]://[this field]/umami.js should resolve to your umami.js"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_script_name
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_script_name
msgid ""
"The name of the script to load. Defaults to umami.js You can leave it as is "
"unless you have a custom script"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,help:website_analytics_umami.field_res_config_settings__umami_analytics_id
#: model:ir.model.fields,help:website_analytics_umami.field_website__umami_analytics_id
msgid "The unique Umami ID uses to identify the website"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__has_umami_analytics
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__has_umami_analytics
msgid "Umami Analytics"
msgstr ""

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_form
msgid "Umami Conf."
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_analytics_host
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_analytics_host
msgid "Umami Host"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_script_name
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_script_name
msgid "Script Name"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model.fields,field_description:website_analytics_umami.field_res_config_settings__umami_analytics_id
#: model:ir.model.fields,field_description:website_analytics_umami.field_website__umami_analytics_id
msgid "Umami Website ID"
msgstr ""

#. module: website_analytics_umami
#: model:ir.model,name:website_analytics_umami.model_website
msgid "Website"
msgstr ""

#. module: website_analytics_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_config_settings_umami
#: model_terms:ir.ui.view,arch_db:website_analytics_umami.view_website_form
msgid "umami.is"
msgstr ""
6 changes: 6 additions & 0 deletions website_analytics_umami/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2022 Yiğit Budak (https://github.com/yibudak)
# Copyright 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import website
from . import website_config_settings
30 changes: 30 additions & 0 deletions website_analytics_umami/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Yiğit Budak (https://github.com/yibudak)
# Copyright 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

has_umami_analytics = fields.Boolean("Umami Analytics")
umami_analytics_id = fields.Char(
"Umami Website ID", help="The unique Umami ID uses to identify the website"
)
umami_analytics_host = fields.Char(
"Umami Host",
help="The host/path your Umami instance is "
"accessible by on the internet. Do not include a protocol here!\n"
"So http[s]://[this field]/umami.js should resolve to your umami.js",
)
umami_script_name = fields.Char(
"Script Name",
help="The name of the script to load. Defaults to umami.js"
" You can leave it as is unless you have a custom script",
default="umami.js",
)

def _get_umami_script_url(self):
self.ensure_one()
return f"https://{self.umami_analytics_host}/{self.umami_script_name}"
22 changes: 22 additions & 0 deletions website_analytics_umami/models/website_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2022 Yiğit Budak (https://github.com/yibudak)
# Copyright 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

has_umami_analytics = fields.Boolean(
"Umami Analytics", related="website_id.has_umami_analytics", readonly=False
)
umami_analytics_id = fields.Char(
related="website_id.umami_analytics_id", readonly=False
)
umami_analytics_host = fields.Char(
related="website_id.umami_analytics_host", readonly=False
)
umami_script_name = fields.Char(
related="website_id.umami_script_name", readonly=False
)
1 change: 1 addition & 0 deletions website_analytics_umami/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Yigit Budak <[email protected]>
4 changes: 4 additions & 0 deletions website_analytics_umami/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module allows to simply configure your odoo website for using Umami_ which is open source, privacy-focused
alternative to Google Analytics.

.. _Umami: https://umami.is/
17 changes: 17 additions & 0 deletions website_analytics_umami/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To configure this module, you need to:

* Go to Settings/Website
* Enable `Umami Analytics`
* Fill in `Umami Website ID` and `Umami host`
* Take care that you fill in the correct value for `Umami host`, it should be
without the protocol (http/https) and without the trailing slash.

Fields Example:

The original Umami tracking code is:

`<script async defer data-website-id="512c723a-a19d-4b71-614f-4d32c1d50fdf" src="https://example.org/umami.js"></script>`

* `Umami Website ID` is `512c723a-a19d-4b71-614f-4d32c1d50fdf`
* `Umami host` is `example.org`
* `Umami Script Name (optional)` is `umami.js` (default value)
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 4f4acb6

Please sign in to comment.