UTM parameters are a series of five URL parameters used by marketers to track the effectiveness of online marketing campaigns across traffic sources and publishing media.
One way to record UTM parameters from visits to your web page is to pass information from the browser URL into hidden fields on a form. When a visitor to your page submits information on a form, the hidden fields are filled with the value of the UTM parameters.
Vidyard's Marketo Form integration uses the Marketo Forms 2.0 API, making it possible to fill visible or hidden fields on a form with custom data, including from query strings in the page URL. This article explains how to pass UTM parameters into a Marketo form that you've added to a video.
There are additional steps required when the Marketo form has been added to a Vidyard video because the parameters must first be passed into the player, and then into the Marketo form. To do this, you will need hidden field(s) on your Marketo form, custom code added to the Event in Vidyard, and custom code added to the page where your Vidyard player is embedded.
If you're not familiar with adding a Marketo form to a Vidyard player, we recommend that you review our article on how to add a Marketo form to your video.
Add hidden field(s) to your Marketo form
In Marketo, you will need to add hidden field(s) to your form so that there is somewhere for the values of the UTM parameters to go. You will need one for each of the UTM parameters you will be using (ie. you will need a hidden field for
utm_source, another hidden field for
Add custom code to the form event in Vidyard
In order to pass UTM parameters into a Marketo form on your Vidyard player, there must be a field(s) 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, and some additional code on the page where the player is embedded.
- Create a Marketo form event in Vidyard.
- Paste that code into your Marketo event in Vidyard, making sure to paste it below the line reading
marketoHandler.form = form;and above the line reading
- Make sure to change the names of
fieldName2, etc., to match the names of the hidden fields you created in Marketo. The name of your hidden field should be the value of Field in your field properties, but with no spaces. You can confirm this in Marketo if needed. In the example below, the field name is
Add custom code to the page where your player is embedded
If your player is on a Vidyard sharing page, no additional code is needed.
If your player is embedded on your own webpage:
- Make sure you are using Vidyard's responsive embed code.
- Add an
<img>tag for your player embed.
- Add the code available here: https://codepen.io/rachel-1/pen/eYpOoee, below the embed code for your Vidyard player.
- In line 10 of that code, we obtain the player by looking for the value of the
idadded to the
<img>tag. Make sure to update the
idin the provided code to match the value of the
idin your player embed.