In this guide, we will walk you through the process of tracking Vimeo video plays on your website and sending these custom activities to Salespanel. By doing so, you can gain insights into how users are interacting with the videos on your site, allowing you to make data-driven decisions about your content strategy.
Step 1: Embed the Vimeo Player
First, you need to embed the Vimeo player on your webpage where you want the video to be played. You can do this by copying the embed code provided by Vimeo and pasting it into your HTML. Make sure to add a unique id to your iframe and a data attribute for your video title.
<iframe id="vimeo-video" data-title="Your Video Title" src="https://player.vimeo.com/video/Your_Video_ID" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
Please replace 'Your Video Title' with the title of your video and 'Your_Video_ID' with the actual ID of your Vimeo video.
Step 2: Include the Vimeo Player JavaScript API
To track the video plays, we need to include the Vimeo Player JavaScript API in our webpage. Add the following script tag to your webpage:
<script src="https://player.vimeo.com/api/player.js"></script>
Step 3: Track the Video Plays
We will use the Vimeo Player JavaScript API to listen for the play event. When a video is played, we will send a custom activity to Salespanel. The following JavaScript code accomplishes this:
<script type="text/javascript">
// Loop through each Vimeo video on the page
document.querySelectorAll('iframe[src*="vimeo"]').forEach(function(video) {
// Create a Vimeo Player for the video
var player = new Vimeo.Player(video);
var videoTitle = video.dataset.title; // Get the video title from the data attribute
// Listen for the play event
player.on('play', function() {
console.log("Vimeo video played!");
// Send a custom activity to Salespanel
$salespanel.push(["set", "activity:customActivity", "Video", "Played a Vimeo video: " + videoTitle]);
});
});
</script>
Please ensure that you replace the Video
category and Played a Vimeo video:
label with your own values if needed.
Note: For the Salespanel tracking to work, make sure the Salespanel tracking code is correctly installed on your website.
That's it! Now, whenever a visitor plays a Vimeo video on your website, Salespanel will track it as a custom activity. You can then use these activities in your segmentation, lead scoring, and trigger automation workflows.