Capturing additional values in Wistia

Ok, you did all the work to setup your Video to capture a form in Wistia from this guide but you’re also capturing email in the url and you’d love to be able to send that information to your FormKeep form without having the user having to re-enter the values.

1. Add some Javascript

You’ll need to add some additional javascript to your page where you’re hosting your video

<script>
  window._wq = window._wq || [];
  _wq.push({
    id: "_all",
    onHasData: function(video) {
      video.addPlugin("formkeepparams", { src: "http://formkeep.com/wistia-plugin-params.js"	});
    }
  });
</script>
<script src="https://fast.wistia.com/embed/medias/##########.jsonp" async></script>
<script src="https://fast.wistia.com/assets/external/E-v1.js" async></script>

Don’t forget to change the ##########.jsonp in the above to your actual video embed ID! Also note this code is different from the one described in the other Wistia document.

2. Name the form elements in Wistia with a fk_

Then you’ll need to add some form elements to the Call to Action html in Wistia

What’s going to happen is that we’re going to look at at the url parameters from your page, so for instance if your url was:

http://example.com/video?email=bob@formkeep.com&favorite_color=red

and you wanted to capture the email and the favorite_color values into your FormKeep form, then you would add the following hidden input form fields to your Call to Action HTML on the Wistia site. You need to add a fk_ to the name for each of them like so:

<input type="hidden" name="fk_email" id="fk_email" value="unknown">
<input type="hidden" name="fk_favorite_color" id="fk_favorite_color" value="unknown">

See How to add a custom Form to Wistia for more detailed instructions about making the HTML changes to Wistia.

3. That’s it!

Now when the form is submitted, the script will fill in the email and the favorite_color values automatically for you and submit the form.

Now that wasn’t too hard! Please feel free to reach out to us in support if you have questions or need help getting this to work