How to track Facebook iframe video on my site with Google Analytics? - facebook

I have this video implemented on my website:
<iframe allowtransparency="true" frameborder="0" height="400" scrolling="no" src="..." style="border:none;overflow:hidden" width="560"></iframe>
What I want to do is to track how many people play the video and watch it full time or at least 1 minute.
I have tried with Event Tracking, but this way is not accurate, because the tracking code I have implemented will be working when the whole iframe is clicked, which is no guarantee that the video will be played.
Actually this method does not work at all.
Any help will be highly appreciated!

Due to the cross-origin nature of your iframe, you won't be able to track the video clicks inside it. You could fire an event when the iframe loads...but as you mentioned, that's not an accurate measure of "plays"
You could upload your video to YouTube, and use the YouTube iFrame API to create and track video plays on your website via Google Analytics Events.
As far as I'm aware, Facebook doesn't have anything similar for their embeds...but I could be wrong.

Related

Facebook oEmbed Video Loading is Choppy

I am using oembed to add a FB video to a webpage. The users will be adding more in the future. When the page loads, the video embedding is really choppy. This doesn’t happen with YouTube or Vimeo videos. I wanted to know why FB was loading differently than the others and noticed that FB initially downloads a blockquote and some javascript. Then after the page loads the js connects to FB and replaces the blockquote with an iframe for the video. The user can see the blockquote being replaced. It’s not smooth. YouTube and Vimeo just download the iframe directly.
I’ve already explained to my user that I can’t control how FB responds to my request. But I wanted to ask if anyone else has seen this and if a workaround exists.

Embed facebook live with html5 video player script

There is any way to embed facebook live video into html page, with a custom video player script like mediaelementjs for example? Using rtmp that provide facebook when you do a live.
I have tested with this embed :
<video width="360" height="203" id="player1" src="rtmp://rtmp-api.facebook.com:443/rtmp/1327296050643313?ds=1&s_l=1&a=ATiweM9l1fKQFUUB" autoplay="true" type="video/rtmp" controls="controls"></video>
and JS init
<script type="text/javascript">
$('video,audio').mediaelementplayer(/* Options */);
</script>
But nothing in the page seems playing. someone have tested a player (maybe html5 player) for facebook live embed in html page?
Thanks
Have you checked the preview_url ? I haven't tested it, but in the documentation seems to be a method to get a preview_url in RTMP strem to preview the video you are recording.
Link to the documentation in Facebook
The problem for this workaound would be that the preview_url is limited to 4 hours and 10 viewers.

Facebook Instant Articles Video not playing

I am embbed a video in my artcile as follows: <figure class="op-interactive">
<iframe class="column-width" src="https://player.ooyala.com/player.swf?embedCode=xxxxxxxx&keepEmbedCode=true" width="320" height="180"></iframe>
</figure> I am embedding this right after the end of the <header> tag.
When I browse to the video URL, the video loads and plays. However, when viewing the article from my instant articles library using my iPhone 6s Plus, I just see a small circle where the video is supposed to be and it doesn't play. I tried a different combination embedding this video per the FB instant articles documentation to no avail. Am i doing anything wrong.

Autoplay embedded videos using Facebook's graph api

I'm embedding a facebook video on a page using:
<iframe style="height: 100%; width: 100%;" frameborder="0" marginheight="0"
marginwidth="0" allowfullscreen="true" title="Facebook video player"
src="https://www.facebook.com/video/embed?video_id=' + videoID + '"></iframe>
Is there a way to make the video auto-play, start muted, etc? Other embeddable video players do this by accepting url params. However, I could find no such thing in the documentation.
p.s. I am aware that FB videos can also be embedded using their JS SDK (which does support autoplay), but I am looking for a way to do it using the above method.
Facebook policy does not allow autoplay of embedded content.
You could try to fiddle a way around with some nasty jQuery stuff to fake the click on the play button but this wont last for long, due to frequently code changes. Either use the JS SDK or use a platform like Youtube.

Share YouTube video on Facebook via API

This is probably not possible, but I'm throwing it out here for anyone with crazy awesome ideas or if they happened to come across some morsel of information about it.
I have an embedded YouTube player (iFrame) using the API, with a custom JS control bar. All that works great.
I want to have a share option, however, since the videos on my site will often appear as overlays, it's not ideal to have the page be shared, but rather the video itself. Is there a way to have a user share the YouTube link directly from my page, rather than just a link to my site?
I already realize the fallback is to create a URL on my site that takes a video id parameter and redirects to the proper youtube page.
Doesn't the embed video from YouTube include all YouTube features by default?
(Thumbs up, share, full screen, etc…)