Background
The Vidyard Marketo Form event type makes use of the Marketo Forms 2.0 API. As a result, it is possible to use this api to fill out visible or hidden fields with custom data, or even information like the player UUID. Passing the Player UUID to the form can be used to determine which video was being watched when the form was filled out.
In order to pass the player UUID into a form field, there must be a field in the form that can be used to store the data, as well as some additional code added to the event to interact with the form.
Solution
- Create a Marketo Form Event
- Add the below code to the event between the Marketo form load and form submit code
var playerId = window.frameElement.src.split('/');
playerId = playerId[playerId.length-3];
form.vals({ "[Field Name]":playerId}); - Replace the [Field Name] value with the "Name" value of the Marketo form field you wish to populate (Check out the video below for a walkthrough on finding your field names).
For a list of other possible functions, please see the Marketo Forms API documentation here.