vimeo.ga.js
vimeo.ga.js copied to clipboard
Uncaught TypeError: Cannot read property 'videoPlayed' of undefined
Trying to implement vimeo.ga.js with Google Tag Manager on this page:
https://www.georgefox.edu/about/index.html
I'm getting console errors like these:
Uncaught TypeError: Cannot read property 'videoPlayed' of undefined Uncaught TypeError: Cannot set property 'timePercentComplete' of undefined Uncaught TypeError: Cannot read property 'timePercentComplete' of undefined
Not sure what I'm missing in my implementation. New to GitHub and Javascript, any help would be appreciated!
Did you ever resolve this?
It might be helpful to review the JS API requirements on this page: https://developer.vimeo.com/player/js-api
You need to throw ?api=1 in order to enable the API to feedback the information that this script relies on, I had a quick look at your URL and couldn't spot that being used (but I appreciate it's been a couple of weeks so you might have worked around it!).
Thanks, William! I didn't know that was necessary, but I'll give that a try!
That didn't seem to help either, unfortunately, although that doesn't prove that I don't need it.
Not sure if this is too late to help you, but I was getting the same error messages.
I tracked it back to a missing parameter pointing to the ID of the iframe. The full iframe code should include the URL to the video, the parameter to start the API, and the ID of the iframe using the API. See below:
<iframe src="https://player.vimeo.com/video/22439234?**api=1&player_id=vimeo-player-1**" id="vimeo-player-1" width="640" height="390" frameborder="0" **data-progress="true" data-seek="true" data-bounce="true"**></iframe>
Also note, if you don't include the data variables, the script still tracks Play, Pause, & Resume, but it won't track progress watched (data-progress), if a user skips forward or backward (data-seek), or if they bounce from the video (data-bounce).
I hope this helps someone :-)
Thanks! I'll take another look at it.
On Thu, Apr 7, 2016 at 9:10 PM, Stephen-WebGuy [email protected] wrote:
Not sure if this is too late to help you, but I was getting the same error messages.
I tracked it back to a missing parameter pointing to the ID of the iframe. The full iframe code should include the URL to the video, the parameter to start the API, and the ID of the iframe using the API. See below:
Also note, if you don't include the data variables, the script still tracks Play, Pause, & Resume, but it won't track progress watched (data-progress), if a user skips forward or backward (data-seek), or if they bounce from the video (data-bounce).
I hope this helps someone :-)
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/sanderheilbron/vimeo.ga.js/issues/36#issuecomment-207201356
Thanks @Stephen-WebGuy I was having the same issue and your suggestion fixed it.
This issue should be closed, as I believe the solution @Stephen-WebGuy offers is spot on.