Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LimeSurvey piwik intergration?

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 4 months ago #88975 by DenisChenu
Replied by DenisChenu on topic LimeSurvey piwik intergration?

vovl wrote:

Mazi wrote: vovl, once you succeeded to integrate piwik, maybe you can create a short tutorial for other users?!

Apparently I was hoping for support on how to do that.

Did you try, in welcomepage.pstl only:
Code:
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.example.net/" : "http://piwik.gsill.net/");
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.setDocumentTitle("{QID}");
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://piwik.example.net/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
Just add
piwikTracker.setDocumentTitle("{QID}");
To default piwik code.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: brettd
The topic has been locked.
More
11 years 3 months ago #90962 by DonMartin
Replied by DonMartin on topic LimeSurvey piwik intergration?
This has not worked for me nor did the solutions posted previously. So I appreciate that this is probably not the correct method or indeed good practice but here is my solution.

1.Assuming Piwik is installed and setup add your Limesurvey root URL as a website to track e.g. www.somewebsite.com/limesurvey (in piwik 1.9.2 this is done by going Settings > Websites > Add new website)

2.This will generate the custom Piwik Javascript tracking code, it will look almost identical to the above posted by Denis.

3.Create a new blank html document, with nothing in it, place the Javascript code just before the </body> tag.

4.Upload the documents to your template folder.

5.Open your welcome.pstpl in the last section after (WELCOME) but before any closing </td></tr></table> tags (this will depend on your template) add a link to your blank page using an iframe.

You then need to style the iframe (not the embedded page) using CSS to make it invisible, you can either add this to your template CSS or do it inline. Below is an example:


<iframe name='iframe1' id="iframe1" src="/templates/mytemplate/blank.html" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 0px;"></iframe>

If you keep this in templates you will not need to worry when you run a LS update. If you use more than one template just replicate it there as well.

…there must be a better way but I have not found it. :blush:
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago #90963 by DenisChenu
Replied by DenisChenu on topic LimeSurvey piwik intergration?
Hello,

Just 2 manipulation,

Add some space in catch
Code:
} catch( err ) {  }

And for survey listing, change the {QID}
Code:
piwikTracker.setDocumentTitle("surveylisting}");

Like i say: in welcome.pstpl for survey accessing and in surveylist.pstpl for surveylisting

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
11 years 3 months ago #90965 by DonMartin
Replied by DonMartin on topic LimeSurvey piwik intergration?
Thank you, I did not add the catch error space before but other than that I followed the previous advice...I think I just placed the javascript in the wrong place within my pstpl file. I have corrected this and it now works.

Thank you :)
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago #90968 by DenisChenu
Replied by DenisChenu on topic LimeSurvey piwik intergration?
the {} break Expression manager

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
10 years 1 week ago #107189 by brettd
Replied by brettd on topic LimeSurvey piwik intergration?
To clarify, are you saying that {} (no space) breaks Expression Manager, but "{ }" is safe to use?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 week ago #107196 by DenisChenu
Replied by DenisChenu on topic LimeSurvey piwik intergration?

brettd wrote: To clarify, are you saying that {} (no space) breaks Expression Manager, but "{ }" is safe to use?

Yes,

Or
Code:
{
}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: brettd
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose