[IMP] website: Google Analytics

task-2790245

- Update existing Google Analytics page for GA4
- Move warning from google_analytics_dashboard.rst to GA doc page
- Remove google_analytics_dashboard.rst as it's no longer useful

closes odoo/documentation#5594

Signed-off-by: Audrey Vandromme (auva) <auva@odoo.com>
This commit is contained in:
“Audrey 2023-08-18 09:27:08 +02:00
parent 143b0151d1
commit 5b6be43481
19 changed files with 46 additions and 109 deletions

View File

@ -9,4 +9,3 @@ Reporting
reporting/link_tracker
reporting/google_analytics
reporting/google_analytics_dashboard

View File

@ -1,32 +1,53 @@
=======================================================
How to track your website's traffic in Google Analytics
=======================================================
================
Google Analytics
================
To follow your website's traffic with Google Analytics:
Google Analytics helps website owners understand how people use their site. It provides data on
visitor demographics, behavior, and interactions, helping improve websites and marketing strategies.
- `Create a Google Analytics account <https://www.google.com/analytics/>`__ if
you don't have any.
To follow your Odoo website's traffic with Google Analytics:
- Go through the creation form and accept the conditions to get the tracking ID.
#. Create or sign in to a Google account using the following link: `<https://analytics.google.com>`_.
#. - If you are setting up Google Analytics for the first time, click :guilabel:`Start measuring`
and go through the account creation step.
- If you already have a Google Analytics account, sign in and click the gear icon in the
bottom-left corner of the page to access the **Admin** page. Then, click :guilabel:`+ Create
Property`.
.. image:: google_analytics/google_analytics_account.png
:align: center
.. image:: google_analytics/GA-add-property.png
:alt: Measurement ID in Google Analytics.
- Copy the tracking ID to insert it in Odoo.
#. Complete the next steps: `property creation <https://support.google.com/analytics/answer/9304153?hl=en/&visit_id=638278591144564289-3612494643&rd=2#property>`_,
business details, and business objectives.
#. When you reach the **Data collection** step, choose the :guilabel:`Web` platform .
.. image:: google_analytics/google_analytics_tracking_id.png
:align: center
.. image:: google_analytics/GA-platform.png
:alt: Choose a platform for your Google Analytics property.
- Go to the *Configuration* menu of your Odoo's Website app.
In the settings, turn on Google Analytics and paste the tracking ID.
Then save the page.
#. Set up your data stream: Specify your :guilabel:`Website URL` and a :guilabel:`Stream name`, then
click :guilabel:`Create stream`.
#. Copy the :guilabel:`Measurement ID`.
.. image:: google_analytics/google_analytics_settings.png
:align: center
.. image:: google_analytics/GA-measurement-id.png
:alt: Measurement ID in Google Analytics.
To make your first steps in Google Analytics, refer to `Google Documentation
<https://support.google.com/analytics/answer/1008015?hl=en/>`_.
#. In Odoo, go to :menuselection:`Website --> Configuration --> Settings`.
#. In the :guilabel:`SEO` section, enable :guilabel:`Google Analytics`, then paste the
:guilabel:`Measurement ID`.
.. tip::
If you have :doc:`multiple websites <../configuration/multi_website>` with separate domains, it
is recommended to create `one property <https://support.google.com/analytics/answer/9304153?hl=en/&visit_id=638278591144564289-3612494643&rd=2#property>`_
per domain. In Odoo, in the **Website settings**, make sure to select the website in the
:guilabel:`Website` field before pasting the :guilabel:`Measurement ID`.
.. seealso::
`Google documentation on setting up Analytics for a website <https://support.google.com/analytics/answer/1008015?hl=en/>`_
* :doc:`google_analytics_dashboard`
.. note::
It is no longer possible for new Google Analytics accounts to integrate their **Google Analytics
Dashboard** inside their **Odoo Dashboard**. Since `July 2023 <https://support.google.com/analytics/answer/11583528>`_,
**Universal Analytics** is no longer supported and has been replaced by **Analytics 4**, which
`doesn't allow <https://issuetracker.google.com/issues/233738709?pli=1>`_ its dashboard to be
integrated into external websites. You now have to check your Analytics data directly in the
Google Platform.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1,88 +0,0 @@
==========================================================
How to track your website traffic from your Odoo Dashboard
==========================================================
.. warning::
It is not possible anymore for new Google Analytics accounts to integrate
their **Google Analytics Dashboard** inside their **Odoo Dashboard**.
Google deprecated **Universal Analytics** which won't be supported anymore in
`July 2023 <https://support.google.com/analytics/answer/11583528>`_. They are
replacing it with **Analytics 4**. New accounts are already using it.
**Analytics 4** `doesn't allow <https://issuetracker.google.com/issues/233738709?pli=1>`_
its dashboard to be integrated in external websites.
You now have to check your Analytics data directly in the Google Platform as
it won't be possible in Odoo anymore.
Accounts created before `October 2020 <https://support.google.com/analytics/answer/11583832>`_
should still be using **Universal Analytics** and be able to integrate their
dashboard on external website until the official end of support `around mid
2023 <https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html>`_.
You can follow your traffic statistics straight from your Odoo Website
Dashboard thanks to Google Analytics.
- A preliminary step is creating a Google Analytics account and entering the
tracking ID in your Website's settings (see :doc:`google_analytics`).
- Go to `Google APIs platform <https://console.developers.google.com>`__
to generate Analytics API credentials. Log in with your Google account.
- Select Analytics API.
.. image:: google_analytics_dashboard/google_analytics_api.png
:align: center
- Create a new project and give it a name (e.g. Odoo).
This project is needed to store your API credentials.
.. image:: google_analytics_dashboard/google_analytics_create_project.png
:align: center
- Enable the API.
.. image:: google_analytics_dashboard/google_analytics_enable.png
:align: center
- Create credentials to use in Odoo.
.. image:: google_analytics_dashboard/google_analytics_create_credentials.png
:align: center
- Select *Web browser (Javascript)*
as calling source and *User data* as kind of data.
.. image:: google_analytics_dashboard/google_analytics_get_credentials.png
:align: center
- Then you can create a Client ID.
Enter the name of the application (e.g. Odoo) and the allowed pages on
which you will be redirected. The *Authorized JavaScript origin* is your
Odoo's instance URL. The *Authorized redirect URI* is your Odoo's instance
URL followed by '/google_account/authentication'.
.. image:: google_analytics_dashboard/google_analytics_authorization.png
:align: center
- Go through the Consent Screen step by entering a product name
(e.g. Google Analytics in Odoo). Feel free to check the customizations options
but this is not mandatory. The Consent Screen will only show up when you enter
the Client ID in Odoo for the first time.
- Finally you are provided with your Client ID. Copy and paste it in Odoo.
.. image:: google_analytics_dashboard/google_analytics_client_id.png
:align: center
- Open your Website Dashboard in Odoo and link your Analytics account to past
your Client ID.
.. image:: google_analytics_dashboard/google_analytics_start.png
:align: center
- As a last step, authorize Odoo to access Google API.
.. image:: google_analytics_dashboard/google_analytics_login.png
:align: center

View File

@ -105,6 +105,11 @@ applications/sales/point_of_sale/payment/worldline.rst applications/sales/point_
applications/services/fsm/default_warehouse.rst applications/services/field_service/default_warehouse.rst # fsm/* -> field_service/*
# applications/websites
applications/websites/website/reporting/google_analytics_dashboard.rst applications/websites/website/reporting/google_analytics.rst
# developer/howtos
developer/howtos/rdtraining/D_mixins.rst developer/tutorials/mixins.rst # reorganize the developer doc