User ID Not Populating in Matomo
Created by: VoIP-Dude
Looking at the Query String Parameters sent to Matomo from my DokuWiKi instance, it's evident the user_id or UID field is missing. The Matomo database in MySQL shows the user_id as NULL. The User IDs and Visitor logs also do not show a user ID.
I'm running Matomo version 3.14.0 and 2018-04-22b "Greebo" for Doku. My tracking code is as follows:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackAllContentImpressions']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//dokuwiki.corp.intranet/analytics/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//dokuwiki.corp.intranet/analytics/matomo.php?idsite=2&rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
I've also experimented with adding with using several variations of _paq.push(['setUserId', 'USER_ID_HERE']); within the tracking code, and elsewhere, without any luck.
Any help would be greatly appreciated!