Manual Goal Conversion

I work for a company that uses Piwik for tracking all site visitors and goal conversions. Since the new update, Piwik hasn’t tracked certain visitors, and if they have tracked them Piwik hasn’t always been able to manually capture the goal. It is pretty hit and miss, which makes me believe that it could be something on our end. After a goal conversion, we set the user ID in Piwik to whatever the user ID in our database is.

Here is our Piwik code we use currently…:


		<!-- Piwik -->
		<script type="text/javascript">
		  var _paq = _paq || [];
		  var cookies = "; " + document.cookie;
		  var cookieParts = cookies.split("; PSPiwik=");
		  if (cookieParts.length == 2) {
		  	var userID = cookieParts.pop().split(";").shift();
		  	_paq.push(['setUserId', userID]);
		  }
		  _paq.push(['trackPageView']);
		  _paq.push(['enableLinkTracking']);
		  (function() {
		    var u="https://siteurl.com/analytics/";
		    _paq.push(['setTrackerUrl', u+'piwik.php']);
		    _paq.push(['setSiteId', 90]);
		    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
		    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
		  })();
		</script>
		<noscript><p><img src="https://siteurl.com/analytics/piwik.php?idsite=90" style="border:0;" alt="" /></p></noscript>
		<!-- End Piwik Code -->

I can confirm that we are getting the user ID correctly from the cookie. Any thoughts on this?