Video is a very important part of the web today, and being able to segment users based on their web-video viewing behavior can be very useful. We created an integration example, using YouTube's API, where a segment is created once the user sees a video until the end.
Therefore, once a user has seen the YouTube video until the end on your site, you can then create a specific behavior, such as showing different content.
Check our Quick start for more information about creating your account and installing tags on your site.
Once these files have been uploaded, make note of the directory where these files were stored - this information will be necessary for step 4.
You must now create a bucket to segment users who saw the YouTube video until the end. Since we will be using a dynamic event sent from YouTube once the viewer has seen the video until the end, we must use the EVENT navigation option:
Copy and paste the following code in your HTML page where you want the YouTube video to be displayed.
Then, you must then replace the code sections shown in yellow below with the variables of your choice. In the bucket configuration used in step 3, we used the youtube_video.
Last, you have to input the alternative HTML code you want shown when the user already saw the video to the end, shown in red.
Possible values are: