Yes, they are supposed to be different, let’s see an example-snippet:
var piwikTracker = Piwik.getTracker(pkBaseURL + “piwik.php”, 1);
As you want to track different sites on the same Piwik-isntallation, please go to Settings=>Websites and add new websites there. Click on “Show tracking-code” to get the specific tracking code for your specific website. You’ll see the difference in the tracking code In the example above the digit “1” would differ.
All past tracking remains unchanged in your database. All new data should be processed correctly.
Basicly you could delete all data of the Piwik-tables as it still is a fresh installation.
If you intend to keep the correct data that was processed already, you would need to clear following tables to the point you adjusted your tracking-code:
piwik_log_conversion,
piwik_log_link_visit_action,
piwik_log_visit,
piwik_log_conversion_item,
piwik_log_action
As well as the data from the dabase numeric archive tables (archive_numeric_) and blob archive tables (archive_blob_).
Piwik basicly never deletes any old information. You could tell Piwik to do so, but by default it does not.
How do I prevent that a website admin configure the wrong website id in his java tag and write the statistics in an other website by accident.
If I provide a piwik installation for different customers it would be very useful to prevent they from writing stats in the other stats.
Its a human error thing really. Once the code for each site is defined as long as they dont do custom recoding to put another domain in their code it should be fine.
When people copy paste from the source of one web site and try and retrofit it for another site then thats where you can get data pollution.
Just ensure they use the code from within the admin section of piwik and they should be good.