How to track if someone starts, or completes watching an embedded Youtube video in your funnel
Before you can use the watch video action feature, you need to make sure that the base Funnelytics script is properly installed in your funnel.
Please refer to this tutorial to do that now.
Currently, we can only track Youtube videos that are embedded on our site using Google Tag Manager.
To do this, we are going to create 2 new tags.
- One that calls the Youtube library (It's like opening the portal that connects your site to Youtube).
- The other one will fire the Funnelytics action event.
Let's get started with the first tag.
YouTube Library Tag
All we are going to do is create a custom HTML tag that fires this simple code snippet:
Under advanced settings > Tag Firing Options set this to fire Once per page
The trigger will be all pages. The tag should look like this when complete:
Watch YouTube video tag
Under the variables tab, we need to make sure that all the video variables are enabled.
To do this, go to the Variables tab > hit configure > under the video section > enable all video variables.
Create a watch video listener (trigger)
Under triggers, we are going to create a listener that will give us information about when a Youtube video is played in our funnel. It will then give us information that matches the variables we just enabled.
Testing the Watch YouTube Video Trigger
Enable preview mode > go to your site > and refresh the page.
**How to embed a Youtube video onto your site is beyond the scope of this article. A quick Google search will provide enough help on how you can embed a youtube video on your site.**
Now, when you click play on the youtube video, you will see a new event under the summary box on the left called gtm.video
If we go to the Variables tab and scroll down to the video variables, we'll be able to see information specific to this video that we can use to fire the tag with.
In this case, we're going to use the Video URL and its corresponding value to target our tag. Copy the Video URL to your clipboard.
Now that we know which video we are targeting, we can change the trigger from All Videos to Some Videos > Video URL > contains or equals > Your URL
Create the Watch YouTube Video Tag
Copy the following code snippet
Go to Tags > New > Give it a name: FL-Action-Watch Main Video > Choose Custom HTML > Paste the code in the HTML field.
remove the section bit of code that reads, 'your_video_title' and replace it with a title that will provide context for your particular video, some like, 'myAwesomeVideo'
The trigger will be our new trigger that we just made.
Test our new tag in GTM and Funnelytics
Refresh the preview mode and refresh the page on the website. This time when the play button is clicked we should see that our new tag was fired. After clicking play on the video we can see that the new tag did fire correctly.
Now, it's time to submit our changes in GTM and test it again and make sure that it fires correctly in Funnelytics.
Check out this article that outlines how to configure our Actions in Funnelytics!
If Google Tag Manager is unable to detect video events, you may need to do much more in-depth troubleshooting. Because this varies so much, we are unable to provide specific support for each case. Please refer to this article from Analyticsmania for additional help.
If you have any questions or need further clarification with tracking embedded Youtube videos, remember to reach out to our support team anytime by clicking the support icon in the bottom-right corner of your dashboard, we are always ready to assist you!