Welcome to the LimeSurvey Community Forum

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

click tracking with limesurvey

  • camillepiton
  • camillepiton's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 weeks ago #149810 by camillepiton
click tracking with limesurvey was created by camillepiton
I need to integrate a click traking kind of question in my questionnaire.

The purpose it to say how many product you buy, so the consumer click as many times as he want on each product of an image.
I want the final number of clicks per product.

This type of question doesn't exist in limesurvey, but i would prefer not to have a HTML source to go to another app.

Would it be possible to integrate it into the script ?
I know nothing about programming language at the moment, but I can learn. Is there a way to do it ? And if yes how (wich language, where can i modify the script) ?

Thanks by advance for your help !
The topic has been locked.
More
7 years 2 weeks ago #149814 by Ben_V
Replied by Ben_V on topic click tracking with limesurvey

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 following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago - 7 years 2 weeks ago #149831 by tpartner
Replied by tpartner on topic click tracking with limesurvey
Maybe answered...but...

If you would simply like to record the number of clicks in the data, you can use JavaScript to detect clicks on an element and increment the value of a text or numeric input.

For example, if using the latest LS version with the default template, setting up your survey to use JavaScript and adding the following script to to the source of a numeric question will increment its value every time an image in the question text is clicked.

Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('#question{QID} .question-text img').on('click', function(i) {
      $('#question{QID} input[type="text"]:first').val(Number($('#question{QID} input[type="text"]:first').val())+1);
    });
  });  
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 2 weeks ago by tpartner.
The following user(s) said Thank You: DenisChenu, Ben_V
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose