- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
click tracking with limesurvey
- camillepiton
- Topic Author
- Offline
- New Member
Less
More
7 years 1 month 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 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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1128
- Thank you received: 329
7 years 1 month ago #149814
by Ben_V
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)
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10115
- Thank you received: 3597
7 years 1 month ago - 7 years 1 month ago #149831
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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.
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 1 month ago by tpartner.
The following user(s) said Thank You: DenisChenu, Ben_V
The topic has been locked.