Welcome to the LimeSurvey Community Forum

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

Add custom JavaScript to a specific question page

  • steveleathers
  • steveleathers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 10 months ago #107957 by steveleathers
Hi,

I'm wondering if it's possible to add a Javascript code snippet to a specific question page.

I'd like to track conversions from a facebook ad to a point about 80% of the way through a survey.

This means inserting a specific code snippet in the JS template, but I only want the code to appear on one instance. Is this doable?

Thanks.
-Steve
The topic has been locked.
  • steveleathers
  • steveleathers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 10 months ago #107958 by steveleathers
Replied by steveleathers on topic Add custom JavaScript to a specific question page
Alternatively, is there a way to create a new template file that is not included throughout the survey, but only added if certain conditions are met?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 10 months ago #107964 by tpartner
Instead of adding the code to a template file, simply add it to the source of any question on that page.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • steveleathers
  • steveleathers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 10 months ago #108014 by steveleathers
Replied by steveleathers on topic Add custom JavaScript to a specific question page
Unfortunately, the Facebook JS code will only be recognized it it's included in the <head>, so including it in the question source or the Survey Completed template doesn't work. :(
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose