Add custom JavaScript to a specific question page

More
3 years 1 month ago #107957 by steveleathers
steveleathers created the topic: Add custom JavaScript to a specific question page
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

Please Log in to join the conversation.

More
3 years 1 month ago #107958 by steveleathers
steveleathers replied the 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?

Please Log in to join the conversation.

More
3 years 1 month ago #107964 by tpartner
tpartner replied the topic: Add custom JavaScript to a specific question page
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.

Please Log in to join the conversation.

More
3 years 4 weeks ago #108014 by steveleathers
steveleathers replied the 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. :(

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now