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

Detected dimensions and metrics need to be site specific #12381

Open
tsteur opened this issue Dec 21, 2017 · 0 comments
Open

Detected dimensions and metrics need to be site specific #12381

tsteur opened this issue Dec 21, 2017 · 0 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@tsteur
Copy link
Member

tsteur commented Dec 21, 2017

Background: Custom Dimensions defines Dimensions and Metrics depending on the requested site. However, all dimensions and metrics are fetched site independent. This is usually not a problem as only one site is fetched per request anyway. However, it is a problem when archiving eg a roll-up which may also trigger the archiving of individual sites within that roll-up.

In this case eg a URL is request &idSite=16 but it also triggers eg the archiving of idSite = 1. Custom Dimensions will then search for dimensions of the site 16 even though we are archiving idSite 1. Even worse this result will be cache site-independent and used for all sites.

We basically need to refactor all Dimension and Metric related method to optionally be requested site-specific. Especially eg these methods:

  • DimensionProvider::getAllDimensions() => could be eg getAllDimensionsForSite()
  • DimensionProvider::factory() => could be eg factoryForSite()
  • Dimension::getAllDimensions()
  • ActionDimension::getAllDimensions()
  • VisitDimension::getAllDimensions()
  • ConversionDimension::getAllDimensions()
  • MetricsList::get() would need to be eg MetricsList::getForSite().

Because it needs to be backwards compatible we ideally introduce new methods for this as otherwise it will be hard for plugins to be compatible for eg Piwik 3.0 and eg Piwik 3.3. Any of those methods that use a cache, whether it is a static property or transient cache, need to be made site specific.

As a result, we also need to update all plugins that have been using any of those methods so far and check whether those instead need to use the method that fetches it by idSite.

Note that some methods won't call the method site specific on purpose, eg the column update checker. We need to check all methods where those methods are called in core whether it actually needs to be requested by site or "overall". Then also update / refactor the methods that call those methods as they might now need an idSite parameter as well.

It may take a while to make this change.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants