Separating users by realms or roles

Not sure how to go about this, but is it possible to be able to separate the tracking based on what realm they are on that website. For example, two companies have merged and share the same exact site but each company has their own security realm, so when users login they belong to one or the other. Is it possible to track only a specific group, as in can one company only track whats in their realm instead of having to share the tracking with the other realm.

If you don’t want to share tracking, you should log with two different websites inside Piwik.
Then invoke the correct idSite including tracking code inside the website based on user’s realm.