If you have many websites that serve the very same web page with a single tracking code, and you just want to use the site URL automatically, then this plugin is for you.

Once the plugin is activated Matomo (Piwik) will start to accept site URL via idsite parameter as part of the tracking requests. You may still use the numeric site ID since that functionality will continue to work. New tracking code generated on Matomo will include the main site URL instead of the numeric site ID. You may as well use one of the other URLs of a website as the tracking ID.

This plugin is for a very simple use case. I'm not planning to add any more functionality. However please do feel free to contact me if there are any issues.

Note: There may be issues if multiple tracking ID plugins (ones that modify the site ID in the tracking code) are enabled. Only one of those plugins should be activated.

Are there any settings?

No. Once the plugin is activated, it starts to do its job.

Is it going to break my existing tracking codes?

No. Matomo (Piwik) will continue to work as normal with the numeric site IDs in the tracking requests.

I have a website with two additional URLs, can I use those as well?

Yes. Matomo will generate the tracking code with only the main URL. However you may modify the tracking code to use any of the site URLs of a website.

Can I use variations of a site URL in the tracking code?

You may use any of the site URLs of a website, as long as they are defined in the website configuration. If there are additional variations, please add them to your configuration first before modifying the tracking code.

Please share