Dude, Where's Our Video Performance?

So here's a fun story from a few years ago.

A client asked me to look into why their video pages were suddenly performing really, really badly out of nowhere. So obviously off I went with my SEO tools and my big bucket of bright ideas to do some analysis, and what I found was kind of interesting so I figured I'd share - apologies for the lack of screenshots, but NDAs and all that innit.

The site had, for whatever reason, some embedded video content hosted on youtube, while other content was hosted on Brightcove. the Brightcove content came with its own built in solution for schema, while the youtube content came with the fact that it all belongs to Google. As such Google is really good at understanding what those videos are, leading to, generally speaking, those videos doing well in the videos tab, appearing in video carousels, and so on.

Except, for some reason, this client's youtube videos weren't - which was doubly weird because their competitor's YT embedded videos were. So what was causing this?

Well, the first thing I did was open a page that had a youtube video embedded on it... and realised there was a big empty space where the video should've been. Initially I put this down to an adblocker or similar, but opening the page in a clean incognito window had the same result, and when I looked into dev tools the request to youtube was showing as "cancelled" or "stalled".

So quickly, let's get in the weeds about why that's important.

Stalled is a status you don't see very often in dev tools, and most often things get stalled due to issues with preflight checks due to CORS.

CORS (Cross-Origin Resource Sharing) is a security mechanism implemented by web browsers that controls how resources on a web server can be requested from a different domain (origin) than the one that served the web page; to put it in simple terms it's a way to control via http headers whether or not a site is allowed to use your content or not, and a preflight check is essentially a special call browsers make to a domain via the OPTIONS method before they request any content to check whether or not they're even allowed to start asking for things.

Except, obviously, there weren't any CORS issues here - this was a youtube embed, the whole point of the url behind the stalled request was for it to be put on other sites, so why on earth was THIS one stalling?

Just to make sure I wasn't going mad, I grabbed a url from a competitor that WAS ranking with an embedded youtube video in order to compare and contrast the two, and lo and behold they were not having the same issue.

I then replicated this in Webpagetest, just to make sure this wasn't a browser or plugin issue and saw the same thing.

At this point I was pretty sure there was something wrong with the embed, but then my very smart friend Anne told me that she COULD see the video on the page, and that set me off in a totally different direction.

See, one of the main differences between myself and Anne is where we live: I'm a big moon-faced Welsh boy, but Anne is from Virginia in the US - and remember, one of us could see the video on the page and one of us couldn't, and the only real difference between the two of us is an ocean and a few thousand miles.

First thing I did was go straight back to WPT and try the same test again with an American IP (Unfortunately my notes don't explain why I was seemingly so dedicated to fixing this without using a VPN on my local machine), and guess what? There was the video, proud as punch.

But why's that then? and more importantly, why is Google, crawling from the US, NOT seeing it? The answer is sort of wild and also sort of really boring and mundane, so read on to be thoroughly whelmed:

It turns out that the site used two different Cookie Banners; One that met US Law, and another that was served to countries who are beholden to GDPR data privacy guidelines. Why, I'm not a hundred percent on, but I'm sure a lawyer somewhere could explain it if we were so inclined to ask (I'm not).

However, first we needed to ascertain whether or not the cookie banner (or more accurately, the off-the-shelf cookie management service the site used) was actually capable of causing the problem. I dumped all my cookies and refreshed, then clicked "accept all" on the cookie banner that popped up (I had previously clicked "decline all"), and WHAM, there was a lovely visible video, proud as punch in the middle of the page where the big gap used to be.

See, it turns out that the GDPR Cookie banner, probably intentionally, is way stricter than the US friendly one and uses a file called OTAutoBlock to define things that should be, well, automatically blocked until such time as explicit consent is given to load them, and almost every youtube video on the site was included on the list (apart from one curious outlier, which DID still rank in video search, thus strengthening my theory). Consider it like a reverse CORS, I guess.

So was Google being served the GDPR cookie banner? A quick trip to search console said that yes, absolutely they were (This was in the days where fetch and render used a proper Googlebot UA) , and a little bit of UA tinkering on my end suggested that any UA with "Googlebot" in it somehow found itself getting the GDPR friendly cookie notice, and thus loading OTAutoBlock and blocking the youtube videofrom playing. This issue wouldn't have been caught in Search console alone because a) the html would have been visible on the page, b) in some instances if the video is low enough down the page a fetch and render of the url wouldn't actually show you whether or not the video was visibly present on the page, and c) all the reporting in search console is designed to tell you about urls that either returned a non-200 reponse or ones that were denied by robots.txt, not ones that were stopped as part of preflight checks as part of the render (Remember Google is so uninterested in the actual rendering of content that it doesn't even really bother to tell you if a URL goes through a redirect).

The client removed Youtube from its list of autoblocked sites and, lo and behold, they began ranking for video again. Case SOLVED.

So what did we learn?

Number one, no matter what you're doing, try and replicate Google as closely as possible. Use a Googlebot UA, use a US IP, check for the presence (or lack thereof) of content without clicking, scrolling or interacting with any element of the page.

Number Two, really look at pages when you're trying to identify issues; the smallest thing can be the first thread that allows you to unravel an issue. Ask yourself questions about what you see and think "does this look right? Should this be here?"

Number Three, wherever possible find a page that is NOT exhibiting the problem you've identified (or ideally, is demonstrating the behaviour that most resembles success) and identify differences between it and the pages you're having issues with. THEN, slowly and methodically change one thing at a time and examine the behaviour you get in response - unless the site is a client site it's entirely likely you are dealing with a black box and you're going to have to slowly throw variants at it until you understand how, and when it processes things differently.