Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Custom Dimension Indexing by Making Action and Visit Slots Independent #23022

Open
Chardonneaur opened this issue Feb 7, 2025 · 1 comment
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged
Milestone

Comments

@Chardonneaur
Copy link

Hi Team,

Description:

Currently, in Matomo, creating a custom dimension is problematic due to the way index slots are assigned. The action and visit level dimensions are dependent on each other, meaning:

If a user creates a custom dimension at the action level, it takes index 1.
If they then create a custom dimension at the visit level, it is automatically assigned index 2, even if there is no visit-level dimension in index 1.
This dependency makes it extremely difficult for users to align measurement plans between different setups, especially when tracking structured data across multiple implementations.

In contrast, Google Analytics handles this differently by keeping action and visit dimensions independent, allowing for consistent index management across different measurement levels. Matomo should adopt a similar approach for greater flexibility.

Steps to reproduce:

  • Create a Custom Dimension at the action level → It gets assigned index 1.
  • Create a Custom Dimension at the visit level → It gets assigned index 2, even though there is no visit-level dimension in index 1.

What I got:

The index slots are dependent on each other, making it difficult to maintain consistency in measurement plans.

What I expected instead:

Action and visit custom dimensions should have independent indexing, similar to Google Analytics, so users can organize their tracking in a structured and predictable way.

Proposed Solution:

Separate the indexing of action and visit custom dimensions so that they do not interfere with each other.
Allow users to manually set and ma

2025-02-07.15-54-04.mp4

nage custom dimension indexes for both levels.
Ensure that existing dimensions are not affected when implementing this change.

@Chardonneaur Chardonneaur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. To Triage An issue awaiting triage by a Matomo core team member labels Feb 7, 2025
@sgiehl
Copy link
Member

sgiehl commented Feb 7, 2025

@Chardonneaur We need to have a unique identifier per site, so it's possible to target that in the tracking code.

Currently you would set a custom dimension during tracking like _paq.push(['setCustomDimension', 3, 'third']);

This would set the value for the dimension with id 3. It doesn't care if it's an action or visit dimension at this point.

If we would have the same ids for each dimension type, we would need to change how the tracking works and the scope would always need to be provided during tracking.

In general this would be doable, but would require changing the tracking implementation for everyone using custom dimensions.

@sgiehl sgiehl added the c: Custom Dimensions For issues related to the Custom Dimensions plugin. label Feb 7, 2025
@randy-innocraft randy-innocraft added triaged and removed To Triage An issue awaiting triage by a Matomo core team member labels Feb 7, 2025
@innocraft-automation innocraft-automation added this to the 6.0.0 milestone Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged
Projects
None yet
Development

No branches or pull requests

4 participants