Page 1 of 1

piwik with CMSMS?

Posted: Thu Jan 14, 2010 10:06 pm
by zeroality
Piwik is a open source stat analyzer for websites. It is very extensive and tracks a lot of things about visitors and your site. http://piwik.org/

When I try to insert this code into a template:

Code: Select all

<!-- Piwik -->
<__script__ type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.obscuregames.net/piwik/" : "http://www.obscuregames.net/piwik/");
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.obscuregames.net/piwik/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript>
<!-- End Piwik Tag -->
it gives me an error when I load the page. I then tried copying that code into an external .js file and linking to the .js file. This gave me no errors but I am not getting any stats! What can I do?

Re: piwik with CMSMS?

Posted: Fri Jan 15, 2010 12:15 pm
by tomgsd
Did you make sure you wrapped the code in {literal} tags?

Eg,

Code: Select all


{literal}

<!-- Piwik -->
<__script__ type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.obscuregames.net/piwik/" : "http://www.obscuregames.net/piwik/");
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.obscuregames.net/piwik/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript>
<!-- End Piwik Tag -->

{/literal}


Re: piwik with CMSMS?

Posted: Thu May 19, 2011 9:04 pm
by kasmalling
I have enclosed the Piwik tag in the {literal} markings and still am having no luck.

Site is at: http://bit.ly/jYc0kS

Piwik tag is at the bottom. Running chrome inspection it looks like the script is working, not sure what is going on.

Any comments / recommendations are appreciated.

Re: piwik with CMSMS?

Posted: Sun May 22, 2011 6:38 am
by Duketown
kasmalling,

No idea what you have done in the meanwhile, but when I check the site, I don't see any error at the bottom. I'm running Safari as browser. Can it have to do with browser (we know IE will not always do what we want it to do).

Duketown

Re: piwik with CMSMS?

Posted: Sun Mar 10, 2013 6:18 pm
by waterman
ran into the same problem. issue was solved in my case by clearing the cache in cmsms.
2 other suggestions:
use the piwik cmsms module to automatically insert the tracking code

use the image tracking link instead or in addition to the normal javascript code. example:
<!-- Piwik Image Tracker -->
<img src="http://www.yoursitename.nl/piwik/index. ... teid&rec=1" style="border:0" alt="" />
<!-- End Piwik -->

marc