No data collected for own site

Hi guys,

my piwik installation works absolutely fine for a couple a websites. the system is on my own webspace located in a subdirectory called www.mydomain.com/stats/
Now I tried to get statistics also for my own website which is located under the root directory www.mydomain.com

But piwik doesnt collect any data for this website. All other external sites are working fine with piwik. I already checked the js snippet twice.

Any ideas why this doesnt work?

http://piwik.org/faq/troubleshooting/#faq_58

thanks for the faq reminder. i checked all the points but it still doesnt work. contrary to the other implemented websites, there are no logs for my own domain in the database under “piwik_log_visit”.

The js tracking code is located as on all other websites right above the closing body tag:


<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.mydomain.com/stats/" : "http://www.mydomain.com/stats/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) 
</script><noscript><p><img src="http://www.mydomain.com/stats/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>

… and in piwik the domain is on first place. so index number 1 should be correct.

Where is the catch?

what’s your site url?

URL

Your tracking code is broken. You are missing {} after the catch block. Should look like the following …


[...]
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>

strange. it is in the file, but doesnt appear online. nevertheless i´ve used a small workaround to fix it.

Thank you very much for your help! Great software and great support :slight_smile:

Are you using Smarty or some other templating system there? Some are using {…} for their own template code.

it is a self-written templating system (not by myself).
so you are right! it is using the brackets for its own purpose…

gonna have to ask the author for a fix. meanwhile i put a var x=0 in between. now it works :wink: