piwik with CMSMS?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
zeroality
Forum Members
Forum Members
Posts: 64
Joined: Mon Aug 14, 2006 10:41 am

piwik with CMSMS?

Post 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?
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Re: piwik with CMSMS?

Post 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}

Green Sheep Design Ltd. - www.greensheep.co.uk
kasmalling
New Member
New Member
Posts: 4
Joined: Wed May 18, 2011 7:32 pm

Re: piwik with CMSMS?

Post 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.
Duketown

Re: piwik with CMSMS?

Post 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
waterman
Forum Members
Forum Members
Posts: 64
Joined: Tue Feb 05, 2008 8:47 pm

Re: piwik with CMSMS?

Post 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
Post Reply

Return to “Modules/Add-Ons”