FormSite
  • 13 Dec 2023
  • 2 Minutes to read
  • Dark
    Light

FormSite

  • Dark
    Light

Article Summary

Summary

This article includes instructions on how to implement the Jornaya javascript snippet within FormSite using our callback function.

FormSite is a form builder that does not allow the user to designate the ID value when creating a hidden input field, which is required for Jornaya's standard implementation instructions. This does not allow the token to be stored in a location that is easily accessible which is typically needed for a webhook.

Need additional support?

If you have any questions or require additional assistance, please contact support@jornaya.com


Instructions

1. From the "Form Editor" tab add a “hidden field” under the 1st question

Formsite1.jpeg


2. Label the field as desired and save
(This hidden field will receive the LeadiD token)

Formsite2.jpeg


3. Click "View Form"
Formsite3.jpeg


4. Open the developer tools and search the "Elements" tab for “textfield”

  • This step is necessary to identify the "id" attribute of the hidden input added
  • In this case the id is "RESULT_TextField-1”
  • Save this id for use in the next step
    Formsite4.jpeg

5. Add a Custom Code Block UNDER the hidden input field that was added in step 1
Formsite5.jpeg


6. Add a callback function to define the hidden input to receive the token value

Callback Function

<script type = "text/javascript">
  function myCallbackFunction(token) {
    var field = document.querySelector("#RESULT_TextField-1”);
    if (field) {
        field.setAttribute('value', token);
    }
}
</script>

Jornaya Campaign javacript

<script id="LeadiDscript" type="text/javascript">
(function() {
var s = document.createElement('script');
s.id = 'LeadiDscript_campaign';
s.type = 'text/javascript';
s.async = true;
s.src = 'YOUR_JORNAYA_CAMPAIGN_SNIPPET_HERE&callback=myCallbackFunction';
var LeadiDscript = document.getElementById('LeadiDscript');
LeadiDscript.parentNode.insertBefore(s, LeadiDscript);
})();
</script>
<noscript><img src='{your_jornaya_campaign_noscript_snippet_here}' /></noscript>

Formsite6.jpeg


7. After saving the custom code block confirm the token is within the hidden input

  1. Click the "View Form" button
  2. Inspect the View Form page and search for ’textfield’ in the Elements tab
  3. Ensure the token is now being written to the ‘value’ attribute of the hidden input designated in myCallbackFunction
    Formsite7.jpeg

8. Check the “Results” tab in FormSite to ensure the leadid_token column is now populating with a LeadiD token value
Formsite8.jpeg


9. Add the same campaign script from your Jornaya Member Portal account to each following question (without the myCallbackFunction tag) and click 'Save'


To get an account specific Jornaya Campaign Code, please see the instructions in our Getting Started guide.

Formsite9.jpeg

Formsite10.jpeg


10. Add the Jornaya campaign javascript to Form Settings / Success Page

  1. Ensure "Enable the text editor" option is unchecked
  2. Add the campaign script after any existing code
    Formsite11.jpeg

11. Confirm the Jornaya javascript is working properly

  1. Save all changes and open the website in a new tab to confirm everything is working properly
  2. Follow the steps in the Create Implementation Testing to confirm the integration is working as expected.

Was this article helpful?

What's Next