Skip to main content

On April 3rd, 2017 Vidyard will be switching to a new user interface. Click here to learn more.

Vidyard Knowledge Center

Embed Vidyard video on a Visualforce page

Embedding a Vidyard video into a Visualforce page allows you to create a rich experience for your Salesforce users while enabling your Vidyard players to track individual analytics for each user that views your content. By viewing the content on a Visualforce page, a user's email address can be automatically tied to the view record for that player. This data can be viewed in the Vidyard Analytics Center, or directly from the user's contact or lead record in Salesforce.

For more information about Visualforce, see An Introduction to Visualforce.

Note: For this example, we will use the inline javascript embed code, however, the steps can also be applied to the other embed types.

Step 1: Create a Visualforce page

For instructions on creating a Visualforce page, refer to the following Developerforce article:

Creating your first page

Step 2: Obtain your player's embed code

To obtain your player's embed code, refer to the following Vidyard article:

Embedding your video

Step 3: Embed your player

Insert your embed code in the the page. See below for an example:

<apex:page >
<script type="text/javascript" id="vidyard_embed_code_XXXXXxxxXXxXXXXXXX"
src="//play.vidyard.com/XXXXXxxxXXxXXXXXXX.js?v=3.1&type=inline"></script
</apex:page>

Step 4: Modify the embed code to track the user

Modify the javascript to include the email parameter. This allows the player to tie the view data to a particular user using the email address associated with their Salesforce user account.

<apex:page >
<script type="text/javascript" id="vidyard_embed_code_XXXXXxxxXXxXXXXXXX"
src="//play.vidyard.com/XXXXXxxxXXxXXXXXXX.js?v=3.1&type=inline&email={!$User.Email}"></script>
</apex:page>

Adding &email={!$User.Email} to the URL adds a reference to the user's email address for tracking in the Vidyard analytics platform. 

When the user views the video, Vidyard will automatically associate the view data with the user.

  • Was this article helpful?