Problems with trackgoal and wrong visit count - Need help


#1

Sorry for double thread, delete - 301 Moved Permanently
So i have problem with visit count. When piwik tracking my custom goals, he duplicate/triggering visits for each goal. One visit is displayed as four or five for example. I dont know why piwik separate them. Should be one visit and it should contain all of these goals.


<head>

<script src="flash.js"></script>
<!-- Piwik -->
<script type="text/javascript"> 
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://site.ru/stats//";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
    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>


  <script type="text/javascript">

//// REFERRER
  if (document.referrer != null)
  {
	_paq.push(['trackGoal', 10]);
   }
//////////// 
   
//// JAVA
   if (navigator.javaEnabled())
{
	_paq.push(['trackGoal', 12]);
}
////////   

  
///// COOKIE
if (document.cookie.length > 0)
{
	_paq.push(['trackGoal', 13]);
}

//// 

///// FLASH
if(FlashDetect.installed){
	_paq.push(['trackGoal', 14]);
}
/////

/// PROXY
<?php
include('proxy.php');
 $myProxy = new proxyCheck(); 
 $myProxy->serverVar = $_SERVER; 
 $headers = $myProxy->checkHeder(); 
if ( isset($headers['HTTP_X_FORWARDED_FOR']) || isset($headers['HTTP_VIA']) ) {
	echo ' _paq.push([\'trackGoal\', 16]); ';
}
?>
////

</script>

<noscript><p><img src="http://site.ru/stats/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Code -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 

</head>
<body>

<script>
/// Tracking mouse move and click
$('body').click(function() {
     _paq.push(['trackGoal', 15]);
});
$('body').mouseover(function() {
	_paq.push(['trackGoal', 11]);
});
/// 
</script>

</body>


#2

Still need help with this.


#3

Still need help.


#4

Can anyone help me with this problem?


#5

Hi, I new with Piwik, but as I understan your code, you are tracking the repeatedly in any if


if (document.cookie.length > 0)
{
	...
}
if(FlashDetect.installed){
	...
}

try to add else between them

Angel


#6

Between what parts of code? Can you show me an example?
And i dont understand how “else” could fix this.


(Matthieu Aubry) #7

This bug Edge case: page view and ecommerce conversion tracked in the same second create wrong visitEcommerceStatus · Issue #4909 · matomo-org/matomo · GitHub was fixed in latest 2.2.0

try it from 301 Moved Permanently


#8

Installed piwik 2.2.0 from main page http://piwik.org/
Still the same problem, one visit displayed as five.


(Matthieu Aubry) #9

@nieeiqubs pease create a ticket with the Javascript code you use to reproduce this bug with 4 visits. The Core Team Workflow: DevelopInDepth - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3