We plan to host many sites in Piwik. Each of these sites is already identified by a global site ID that we use elsewhere in our business. Thus it would be handy to use the same ID in the Piwik tracking code and API calls, so we don't have to define a mapping of our global site ID to the Piwik site ID.
This also seems to follow good design practices IMHO. Piwik could encapsulate its own internal site IDs, and not require other systems to be aware of these IDs, if the administrator desires.
Here's one way to solve this:
Does this sound like a useful feature? It seems helpful to have the flexibility to define our own custom site ID. And it doesn't seem too impactful to the code base, db schema, or existing use cases. But I'd like to hear what the core team thinks.
Also, would it make more sense to implement this as a plugin? I'd be concerned about performance. But maybe it's not so bad to do a lookup or join to the piwik_site table from a plugin. I haven't looked closely at the Piwik plugin API yet.
Thanks for the suggestion. At this stage this is not scheduled for 2.x. But it's definitely a reasonable and quite useful feature request!
I am meeting the same requirements, +1
This would indeed be very helpfull
This would be a welcomed addition +1
This could maybe be done in a Third party plugin, see @tsteur explanation in https://github.com/piwik/piwik/issues/9975#issuecomment-203092388
@mattab @tsteur I think that this can be developed like this https://github.com/joubertredrat/Piwik-ProtectTrackID
But, is possible to plugin have your tables on database or manipulate other database? If is possible, then, is create link between table with idSite and plugin table to provide this custom id.
@joubertredrat Great to see you released the plugin on the marketplace! if you have any further question or issue, please consider creating a new issue (or if not so important, asking in https://forum.piwik.org/c/plugins-platform )
It would be very usefull to keep our ui app agnostic from environment.
We have a piwik per environment so for the same app, the project id is different on each environment.
It's very unconveninient
Most helpful comment
It would be very usefull to keep our ui app agnostic from environment.
We have a piwik per environment so for the same app, the project id is different on each environment.
It's very unconveninient