Matomo and MatomoCloud services settings save issue

Created on 17 October 2022, over 2 years ago
Updated 8 February 2023, about 2 years ago

Problem/Motivation

On tacjs services form (/admin/config/system/tacjs/add-services), on save, Matomo data is duplicated in Matomo Cloud if config is empty, then when trying to change data in Matomo fields while changing nothing in Matomo Cloud fields, nothing change after save.

Proposed resolution

Change in assets/content.json Matomo Cloud code part from :

"code": {
        "js": "tarteaucitron.user.matomoId = ###SITE_ID###;",
        "html": "<script>tarteaucitron.user.matomoHost = '###YOUR_MATOMO_URL###';</script>"
      },

to :

"code": {
        "js": "tarteaucitron.user.matomoCloudId = ###SITE_ID###;",
        "html": "<script>tarteaucitron.user.matomoCloudHost = '###YOUR_MATOMO_URL###';</script>"
      },
🐛 Bug report
Status

Postponed: needs info

Version

6.1

Component

Code

Created by

🇫🇷France amaloisel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France amaloisel

    Hi Boulaffasae !

    I looked for this issue today and I'm not sure there are same service. Indeed in tarteaucitron.services.js, Matomo and MatomoCloud don't call the same php file for tracker neither same js script for tracking. What I understand is that the difference is the hosting of the solution and so nobody will use both of them.

    I don't know how to manage it to avoid the save issue when setting data in services config form of the module.

  • 🇫🇷France mably

    Hi @amaloisel, is the problem still present and unsolved?

    Otherwise I will close this issue.

  • 🇫🇷France amaloisel

    Hi @mably

    I think we can close as Matomo is deprecated so soon only Matomo Host will be used.
    I still face an issue while saving data :

    1. Set any value for SITE_ID and YOUR_MATOMO_URL for Matomo (privacy by design) service and save the config form.
    2. Check that your values are well saved in the service. If you enable Matomo Cloud (privacy by design) service, you will see that your values are also set in these fields.
    3. If you try to modify your values from Matomo (privacy by design) and save the form, this will do nothing. You have to enable Matomo Cloud (privacy by design) service, modify values and disable it before saving.

    This is in fact possible to deal with this issue but the webmaster is not that satisfied. This is not a major issue and the fix would be a bit complicated I guess. May be save values only for enabled services...

    We can give up

  • 🇫🇷France mably

    @amaloisel you can rather disable unneeded services and only display the ones you are interested in.

    Simply use the hook hook_tacjs_content_alter to filter out all the unneeded services.

  • 🇫🇷France amaloisel

    This would be a great solution if the product of the customer was not a site factory... :D
    They are not complaining anymore, we can close !

  • 🇫🇷France mably

    Ok, I close this issue.

    The best solution would probably be to implement a tacjs extension for the Matomo Drupal module: https://www.drupal.org/project/matomo

Production build 0.71.5 2024