matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.85k stars 2.64k forks source link

Copy custom dimensions settings across sites #16151

Open loopmode opened 6 years ago

loopmode commented 6 years ago

Hi How can you copy custom dimensions settings from one site to another? Can you just clone the rows in the database and change the siteId? (Seems quite scary for non-DB people like me..)

heurteph-ei commented 3 years ago

Mentioned in the forum: https://forum.matomo.org/t/duplicate-custom-dimensions-among-site/21388/

9joshua commented 1 year ago

Third party plugin which claims to do this: https://github.com/NatLibFi/CustomDimensionsManager

EreMaijala commented 1 year ago

@9joshua I'm the author of the plugin, and any feedback is welcome. I'd love to see the functionality as part of CustomDimensions plugin, though.

heurteph-ei commented 1 year ago

Hi @tsteur, What do you think about including EreMaijala's plugin in Matomo core? If not possible, @EreMaijala, don't hesitate to add your plugin to Matomo official market place: Don’t hesitate to share your plugin to the Matomo plugins marketplace thanks to: https://developer.matomo.org/guides/distributing-your-plugin

tsteur commented 1 year ago

@EreMaijala adding the plugin to the Matomo Marketplace be awesome.

@heurteph-ei Good question re integrating into core. I can't really say much as I can't really make that decision and am not sure how many people need this feature. It sounds like maybe not too big of a user group needs it and then it may be better as a plugin on the Marketplace. If it's in the core, we would probably want a UI for it and would also need to add tests etc so it's not super straight forward to just move it into core unfortunately.

It be great to learn more about the use cases here. If people need this feature, please comment. It does help us understand demand more.

heurteph-ei commented 1 year ago

Hi @tsteur In our case, we manage intranet websites, and we have a template measurable, that we copy "by hand" for common config, including common custom dimensions...

EreMaijala commented 1 year ago

@tsteur I'll see what I can do about the Marketplace.

Our use case is that we add new sites using Matomo API and need all sites to have the same custom dimensions, so we use one site as a template and then synchronize the settings to all other sites with a cron job.

9joshua commented 1 year ago

@heurteph-ei @EreMaijala A little of topic but you could create a template website and use the migration tool to copy the template settings to other instances. I did some testing and found it is possible for the 'source' and 'target' server to be the same (targeting the same instance providing the website data). This means you can have a template site which can be duplicated when adding new sites to another instance or to the same instance, including Custom Dimensions settings, etc.

heurteph-ei commented 1 year ago

Hi @9joshua Good idea, but... When I read the doc:

Before executing the migration command we always recommend to make a backup of the target database and ideally also test it first with the dry-run flag (dry-run is faster but can take a long time as well and will give you an idea of how long migration will take).

It seems too risky for just a standard admin action... :worried:

EreMaijala commented 1 year ago

CustomDimensionsManager is now available on the Matomo Marketplace.