Streaming live at 10am (PST)

Ability to detect play event with the pre-built video element

Hey there! So, I’m using the prebuilt video element under the “Media” category.

Then, using a Vimeo video link under the video element’s settings.

All working perfectly.

What I need is the ability to detect when the video is played so that I can send an analytics event. I’ve seen older threads that answer this question using a custom Vimeo embed, but, in this case I’m using the pre-built video element Webflow gives and then just plugging in a Vimeo link under settings.

What custom code would be needed to detect a play event?

Help would be awesome!

Screen Shot 2021-06-03 at 4.37.31 PM

Welcome to the community, @Farza_Majeed :grinning_face_with_smiling_eyes: I’m glad that you’re here!

Great question about tracking play events! That’s usually done through Google Tag Manager or another analytics platform. Are you trying to track the number of video plays from a specific site page?

Here’s a guide on integrating Google Tag Manager on Webflow sites ➞

It usually takes a little bit of time for the tracking to start pulling through (usually it’s working within a day once the script and event is in place).

I hope that this is helpful! :grinning_face_with_smiling_eyes:

Hello! Really appreciate the response. So basically, I’m looking to send a pretty custom event. Basically, if I can do a console.log(“played video”), that would solve my problem and I can write whatever custom code I need under that log :).

So, would likely need some custom JS to catch the play event but I for the life of me can’t figure it out b/c Webflow uses something called Emebedly vs a straight-up Vimeo embed and it’s tripping me up!

Vimeo has a JS library you can load, then listen for the play event and run whatever code you want.

Hmmmm so tried this, but it doesn’t play nice with the actual embed the pre-built video element on Wbeflow uses. If you have some code I could use to detect a play event on a pre-built video element that’d be awesome!

How about dropping the pre-built Webflow stuff?