Thanks for the inputs and update.
Maybe there are caveats I don't know about, but I have found async tracking to multiple websites to work properly.
However, when I updated from 1.9.2 to 1.12, async tracking stopped working when tracking to 2 websites. Both hits were being tracked in the 2nd website. I changed the code on my website to implement synchronous tracking, but it also failed.
If I use the javascript files (piwik.js and the js directory) from 1.9.2, tracking multiple websites worked properly again.
Here is the tracking code from my website which works on 1.9.2, but doesn't on 1.12.
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
(function(){
var u=(("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
_paq.push(['setSiteId', 1]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setSiteId', 2]);
_paq.push(['setCustomVariable','1','XXX','CV1','page']);
_paq.push(['setCustomVariable','2','XXX','CV2','page']);
_paq.push(['setCustomVariable','3','YYY','CV3','page']);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setDomains','*.example.com']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setLinkTrackingTimer', 750]);
var d=document,
g=d.createElement('script'),
s=d.getElementsByTagName('script')[0];
g.type='text/javascript';
g.defer=true;
g.async=true;
g.src=u+'piwik.js';
s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Tag -->
I will retest the synchronous code since there may have been some caching issues--the same ones that steered me to trying the old javascript files. Let me know if there are details I can provide to help debug/characterize this.
I would like to understand what is happening and if it is a bug, have it fixed as I'd like to use the official code/scripts.
Maybe there are caveats I don't know about, but I have found async tracking to multiple websites to work properly.
However, when I updated from 1.9.2 to 1.12, async tracking stopped working when tracking to 2 websites. Both hits were being tracked in the 2nd website. I changed the code on my website to implement synchronous tracking, but it also failed.
If I use the javascript files (piwik.js and the js directory) from 1.9.2, tracking multiple websites worked properly again.
Here is the tracking code from my website which works on 1.9.2, but doesn't on 1.12.
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
(function(){
var u=(("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
_paq.push(['setSiteId', 1]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setSiteId', 2]);
_paq.push(['setCustomVariable','1','XXX','CV1','page']);
_paq.push(['setCustomVariable','2','XXX','CV2','page']);
_paq.push(['setCustomVariable','3','YYY','CV3','page']);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setDomains','*.example.com']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setLinkTrackingTimer', 750]);
var d=document,
g=d.createElement('script'),
s=d.getElementsByTagName('script')[0];
g.type='text/javascript';
g.defer=true;
g.async=true;
g.src=u+'piwik.js';
s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Tag -->
I will retest the synchronous code since there may have been some caching issues--the same ones that steered me to trying the old javascript files. Let me know if there are details I can provide to help debug/characterize this.
I would like to understand what is happening and if it is a bug, have it fixed as I'd like to use the official code/scripts.