We want to send different events from the same projects but into two different websites..
Will it be OK to
setSiteId every time we send an event or there is a better approach to this?
_paq.push(['setSiteId', 1]); _paq.push(['trackEvent', 'foo', 'bar']);
It's best to use addTracker:
It depends on what version of Piwik you use how it is implemented, please find documentation on the following pages:
This is duplicating.. (I guess I had to be more clear). I want to send to a different website depending on the kind of event.
Some events will go to
ID: 1 and some will go to
A new use case ;)
The problem with your solution, could be that other tracking requests, the ones that will be tracked after the
_paq.push(['trackEvent',`` 'foo', 'bar']);
will end up in the wrong ID.
Make sure you reset
to the default ID after the tracked event.