Reputation: 4555
I need to check if a user has actually seen an embedded youtube video (meaning that he pressed play and saw until the end). Is it possible to do this with the youtube api (javascript)?
Thank you very much
Regards
Upvotes: 2
Views: 3908
Reputation: 341
Using the Youtube API is the most easiest way determining if the user clicked the play button.
For starters check out the Google Youtube Api: https://developers.google.com/youtube/js_api_reference
You will be needing to use the Swfobject.js to load the video to use the Youtube API controls
Sample coding on checking the current state of the loaded video: https://developers.google.com/youtube/js_api_reference#SubscribingEvents
Upvotes: 1
Reputation: 127
If it is a chromeless YouTube player or if you embedded the video via JW Player, then it is possible.
The chromeless player will strip out the coding and allow you to embed the YouTube video like javascript, once done, then you can embed a Google Analytics extension snippet/code to the address of the video and track the hits that way. Another way is installing JW Player which allows you to easily track analytics for YouTube videos by incorporating your Google Analytics UPI.
Upvotes: 0