You run a Page Speed test on one of your pages.
Then, you embed a YouTube video onto that page.
Then, you run a Page Speed test again, on the same page.
You find that the Page Speed has decreased.
But...why? Google, which owns YouTube, is so keen on telling people to have fast-loading pages, yet when you embed one of their own assets (YouTube videos), your Page Speed decreases.
This is frustrating, and I’m sure Google/YouTube knows about this and will come up with a resolution in the future.
Until then, what are the options?
That’s essentially what Angie, a participant on the November 5th Google English SEO Office-Hours, asked Search Advocate John Mueller.
(Video queued to the 5-minute, 6-second mark.)
Angie seems to be a bit tech-savvy, and I’d ask you to listen to the video to get the exact details, but basically, her question--which I’ve edited--went like this:
“First of all, I work on a blog website, and for Core Web Vitals, we have a feature where we put a Youtube video at the top, so that became the LCP element, so it was heavier than what we just had (like a regular image).”
Basically, the addition of the YouTube video, since it was the ‘largest’ element on the page (at least, near the top of the page), basically would’ve been the element that took the longest to load (since it was the largest), and since it was likely a larger file size than the image that was there before it, the LCP was negatively affected.
“...so we're trying a method where we're dynamically injecting it where I saw a web.dev article that suggested lazy loading with a facade…”
She basically went on to say that she used a method whereby the video’s iframe is dynamically injected when the user clicks the play button (rather than load right away).
However, she was now noticing that the articles weren't indexing with the page content.
She asked these 3 options: submitting a video sitemap, noscript, and structured data.
John’s response, which I’ve sort of summarized, was:
“Yeah, depending on the way that you set up the kind of the facade that you mentioned there, where you click on an image essentially or a div or something, and then it loads the video in the background, it can definitely be the case that we don't automatically pick it up as a video when we view the page…”
John goes on to mention how he receives contradictory advice from the video team and the ‘other team.’
But anyway, before that, he did say things like:
“...essentially, the best approach there are at least, is to make sure that with structured data we can tell that there's still a video there, so i believe there's a kind of structured data for specifically for videos that you can add.
“Video sitemap is essentially very similar in that regard, in that you're telling us, On this page, there's a video that is relevant.”
But, for Video Object Structured Data, What About Content That Google Can’t See?
This is a viable question, because if the video loads only after an image or facade is clicked on, then the video may not be visible to Googlebot.
To thins, John said:
“I think that's fine. No, I don't think you have to worry about that.
“That's specifically like if there were no actual video on the page--that would be a problem, and specifically with text-based structure data that's something we can try to figure out automatically, but when it comes to videos, there are lots of different ways of embedding videos and some of the ways to embed videos we just don't pick up automatically, and because of that, we have the structured data, so from that point of view that should be fine.”
“We Generally Ignore the noscript Tag”
About noscript, Angie asked:
“How does Google handle that?”
John’s answer, basically, was:
“We generally ignore the content in the noscript, so I don't think that would be a workaround if you're trying to include something for indexing. So, from that point of view, I would use the other methods.”
So, there you have it, the facade spoken about in Lazy Load Third-Party Resources With Facades, combined with video structured data and a video sitemap are the way to go.
Of course...that’s until Google can find a faster way to get embedded YouTube videos to load.