7

Background: I've never accepted all cookies on Stack Overflow. Note: I do not block any cookies.

When I'm viewing this latest blog post for example, it has 7 huge gaps between paragraphs where the YouTube videos should be, which makes it harder to read as I have to scroll the blank space in order to read more content.

Example for such a gap: screenshot of huge gap between paragraphs

And there are six more, about same height.

Browser: Chrome latest stable version, Windows 10 OS.

No errors in developer console, no 400/500 errors in Network tab after reloading the page.

After accepting targeting cookies (Incognito mode just to test it) and reloading, videos appear.

If some cookies are essential for YouTube for some reason, can this please be made clear on the page itself, or even better, show fallback text "Please accept targeting cookies to view the video"?

8
  • I can see some YouTube links in Page Source. For Firefox: view-source:https://stackoverflow.blog/2022/10/07/missed-our-flow-state-conference-catch-up-on-all-the-sessions/ Oct 7, 2022 at 17:45
  • 2
    @RandomPerson I see complex iframes, didn't dig into them though and it doesn't matter: modern sites should have fallback to show something. Oct 7, 2022 at 17:46
  • 5
    If the videos are not supposed to load, there should be a clear placeholder indicating that "this video requires cookies to load", not just a blank space. Oct 7, 2022 at 18:10
  • @Sonic exactly, I've used almost same wording before reading your comment. Oct 7, 2022 at 18:11
  • 1
    "Not accepting all cookies leads to YouTube videos not loading in blog posts" — Do the videos show up when you accept cookies? Because I've viewed the page incognito and after rejecting all the cookies and I still see all the videos (iOS).
    – Laurel
    Oct 7, 2022 at 18:24
  • 1
    @Laurel yes, after accepting I see it. Oct 7, 2022 at 19:29
  • 3
    (After testing the different cookie settings in an incognito window, it looks like enabling "Targeting Cookies" is the particular setting that causes the videos to appear.)
    – V2Blast
    Oct 7, 2022 at 22:14
  • 2
    @V2Blast thanks for the time you put into it! Oct 8, 2022 at 7:57

1 Answer 1

10
+250

We switched the embed type (from YouTube’s tracking embed to their cookie-free embed). This means YouTube no longer tracks you on video load, so conflicts with your Stack Exchange tracking cookie settings should no longer affect these videos loading.

It looks like this was a consequence of privacy tools doing… well, the right thing, in an edge case. When a user on Stack Exchange has tracking cookies off and goes to the blog, the blog tries to load videos from YouTube. But YouTube's default video embed does implement tracking cookies. The net result is that the YouTube videos simply don’t load, leaving a big blank square. Which is, strangely, the correct and desirable behavior in this case. However, since they offer an alternative embed that does not implement tracking cookies (youtube-nocookie.com), we just switched over to that one.

5
  • I'm not sure I understand the whole cookies thing, I don't have any privacy tool installed, I don't have tracking cookies off, I just never accepted the cookies consent dialog of SE, and I never had any problems viewing YouTube videos elsewhere. But anyway, final result is that it's now working, so thanks! :) Nov 17, 2022 at 18:07
  • Not accepting targeting cookies means the site isn't allowed to store browser cookies on your computer for those purposes. Basically, unless you say "Yes, you can store these cookies on my computer", we (or YouTube) can't do it – so whether you reject them or just don't accept them in the first place, it has the same effect either way.
    – V2Blast
    Nov 17, 2022 at 20:05
  • Is there any tooling going out to ensure this mistake isn't made in the future? Nov 17, 2022 at 20:15
  • 1
    @Sonic It's a settings change within WordPress, not a bare text change to the blog's content, so I don't think any additional tooling is needed to make sure it's consistent past & future.
    – Slate StaffMod
    Nov 17, 2022 at 20:18
  • @V2Blast yes, this I get, but the consent dialog is of Stack Exchange, I'm pretty sure I accepted YouTube's cookies long long ago already, and I don't get any consent dialog on their side now, that's where it's getting confusing for me. (The cookies relationship between two different sites.) Nov 18, 2022 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .