Welcome to the LimeSurvey Community Forum

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

count thenumber of click on a link

  • ledoux
  • ledoux's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 10 months ago #154764 by ledoux
count thenumber of click on a link was created by ledoux
Hi the community,

I would like to know if the respondent have clicked on a URL link that is integrated in the introduction page (this link calls a PDF page hosted in an external server). Is that possible? what would be the process to create this "counter"?

if possible, we should keep it simple, given that I don't code (few html and logic).

thank you !

New user of LS but with the will to contribute to this great community !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago - 6 years 10 months ago #154781 by tpartner
Replied by tpartner on topic count thenumber of click on a link
It's not easy to count something from the welcome screen but if you hide that and place the welcome message in the first survey group, you can use JavaScript to load a hidden short-text question with the clicks.

1) Run the survey in group-by-group mode.

2) Place your welcome message in a text-display question in the first survey group.

3) Add a class "count-clicks" to the <a> tag of the link to the PDF.
Code:
<a href="pathTo/PDF" target="_blank" class="count-clicks">Link to PDF</a>

4) Add a short-text to that group and give it a CSS class "hidden".

5) Add this script to the question source of that question:
Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){      
    $('a.count-clicks').on('click', function(e) {
      $('#question{QID} input[type="text"]').val(Number($('#question{QID} input[type="text"]').val())+1);
    });
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 10 months ago by tpartner.
The following user(s) said Thank You: ledoux
The topic has been locked.
  • ledoux
  • ledoux's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 10 months ago #154859 by ledoux
Replied by ledoux on topic count thenumber of click on a link
Thanks Tpartner, very clear
the only doubt is "Add this script to the question source of that question:" you mean in the CSS files or in the settings of the question ?
thank you again

New user of LS but with the will to contribute to this great community !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #154869 by tpartner
Replied by tpartner on topic count thenumber of click on a link
Please refer to the manual on how to use JavaScript in the question - manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ledoux
  • ledoux's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 10 months ago #154870 by ledoux
Replied by ledoux on topic count thenumber of click on a link
Tpartner
Sorry but I did a mistake, actually the link is in the invitation email... is there any solution then ? Do I have to deal with my web-host (OVH) ?
Thank you

New user of LS but with the will to contribute to this great community !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #154873 by tpartner
Replied by tpartner on topic count thenumber of click on a link
Sorry, that's not a LimeSurvey issue so I cannot help.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ledoux
  • ledoux's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 10 months ago #154875 by ledoux
Replied by ledoux on topic count thenumber of click on a link
The link is in the invitation email sent in LS plateforme ... so it is a LS issue isn't it?

New user of LS but with the will to contribute to this great community !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #154876 by tpartner
Replied by tpartner on topic count thenumber of click on a link
In my opinion, no. LimeSurvey cannot track the behavior of an email recipient, regardless of the source of that mail.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 10 months ago #154877 by Ben_V
Replied by Ben_V on topic count thenumber of click on a link
Hi,

I think you can use a custom token attribute to record a yes/no value depending if your document was open or not (default)...

Obviously your link have to fire a small script before accessing the document to update the token value to "yes" (necessary to pass the token ID in the link).

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose