close this to read article
Using VWO, you can track the number of users who played the Wistia Video on your website. The end-to-end process for setting up Wistia video tracking involves the following steps:
- Create a custom conversion goal in VWO.
- Adding code snippet to track the video plays.
Create a Custom Conversion Goal in VWO
- Create a test and define a custom conversion goal to track.
- Select the URL matches pattern and enter the URL pattern for the pages where the videos are hosted.
- Normally, the custom conversion triggers on a specific page – a thank-you page or something similar. However, in our case, we want the goal to trigger conversion everywhere the Wistia video appears on the website. For this, we use a wildcard (*) to define the URL pattern so that the conversion will occur on every page of the website that contains the VWO SmartCode.
- On the last page of the test creation process, copy the custom conversion code generated for the goal.
- Make a note of the goal ID highlighted in the screenshot. You will need it at a later stage.
Adding Code Snippet to Track The Video Plays
To start tracking the video plays, execute the JS code shared below. This JS code can be placed via any preferred method:
- You can fire this code via GTM.
- If you are using the A/B test or Rollouts, this code can be placed inside the code editor. Place the code inside Variation-JS (if the video is available only inside Variation) or Pre-JS | Post-JS (if the video is available in both control & variation)
To learn more, refer to our Video Heatmap blog.