Welcome, Guest
Username: Password: Remember me

TOPIC: Add custom JavaScript to a specific question page

Add custom JavaScript to a specific question page 3 months 3 days ago #107957

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 administrator has disabled public write access.

Add custom JavaScript to a specific question page 3 months 3 days ago #107958

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 administrator has disabled public write access.

Add custom JavaScript to a specific question page 3 months 3 days ago #107964

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4069
  • Thank you received: 746
  • Karma: 341
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Add custom JavaScript to a specific question page 3 months 11 hours ago #108014

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 administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.115 seconds
Donation Image