Preparing for third-party cookie phase out

1. Background

I have posted some tips recommending Google drive as a host for images and other media:

Animated gifs
https://www.googlecloudcommunity.com/gc/Tips-Tricks/Animated-gifs/m-p/255103

No server for media, no problem
https://www.googlecloudcommunity.com/gc/Tips-Tricks/No-server-for-media-no-problem/m-p/695452

Unfortunately, due to "Upcoming changes to third-party cookie requirements in Google Drive" (https://workspaceupdates.googleblog.com/2023/10/upcoming-changes-to-third-party-cookies-in-google-dr...) I'm quite sure that the sort of usage recommended in these posts of mine will no longer work in the future.

2. Testing third-party images

I referred to this video in learning to test to see what will break:

https://developers.google.com/privacy-sandbox/3pcd/prepare/test-for-breakage

Put simply, I did the following:

  1. Turn off permission for third-party cookies in browser
  2. Make simple html text file to display image, like the following:
    <html>
    <head>
    <title>Image Display</title>
    </head>
    <body>
    <img src=" put the URL you want to test here ">
    </body>
    </html>โ€‹


  3. See if the tiny page with your image in it will display in the browser with third-party cookies turned off

As a result of my testing I found the following:

No good

  • Still images and animated gifs hosted on Google Drive

OK

3. Things I found (or still find) confusing

  1. Even in a browser with third-party cookies turned off, you can display an image with the following URL directly in the browser by pasting the URL into the address line:
    https://drive.google.com/uc?id=14fpsJkz8jBz6Je_uHcxonnqsCK3RBCK4
    But, this won't work inside a simple HTML page with the cookies turned off so I'm pretty sure it's not going to work after February.
  2. Even with the cookies turned off, everything still works on my apps when I run them in the browser. I'm pretty sure the reason for this is that AppSheet is handling the cookies for the images but that this will come to an end on or not long after February 2.

4. Workarounds

Animated gifs
Hosting animated gifs on Google Drive used to be a workaround that was necessary because, for some reason, gifs hosted on most servers didn't work inside AppSheet's image columns. Fortunately, however, as @Koichi_Tsuji has reported, that issue has been resolved (https://www.googlecloudcommunity.com/gc/Tips-Tricks/GIF-file-now-animation-is-preserved/m-p/327057).  So, if you have a server to host your gifs, you don't need Google Drive anymore. Or, you can use gifs that others have made, such as gifs from Giphy.  However, if you try to put gifs directly into AppSheet via an app's uploading interface, it won't work.

Still images
If you are not satisfied with AppSheet's normal image columns and want, for example, to display images via the HTML rich text that is now available in Long text columns, you'll need your own server or some other service on which to host your images.  By the way, one advantage of displaying images via HTML inside Long text columns is that they can be made portrait (taller than wide), something that current image columns do not allow.

I'm not sure how stable or secure this is but a workaround for images that are currently in Google Drive is "Embed Google Drive Images": https://www.labnol.org/embed/google/drive/
For some reason, the following conversion of URLs produces images that do not rely on third-party cookies. For example, 
https://drive.google.com/file/d/14fpsJkz8jBz6Je_uHcxonnqsCK3RBCK4/view?usp=sharing
is converted to
https://lh3.googleusercontent.com/drive-viewer/AEYmBYS8A09RxR5Fh-4aboqJfwOJUJDYV32u7hb74Mw3HvDF1d99V...
which passes the third-party test described above. ih3 seems to be how Google Photo images start so it seems that the tool provides a URL  associated with Google Photos that is free of third-party cookies.

Postscript

Please see additional workaround for images in a comment of mine.

5. Conclusion

That's my understanding at this point. If errors are identified in comments, I'll correct this post.  Please let me know if I'm wrong about something or if there's something important that I've missed.

4 3 703
3 REPLIES 3

I found something that I think is interesting and may be useful to people who have apps that are currently relying on images with third-party cookies.

I used the following sort of URL to pull in a couple thousand images of Chinese characters to make "character cards" that can be used in my flashcard app:

https://kanji.askbox.net/img/ไธ€.png

Even now, this is how the URL appears in the image column of my spreadsheet.  Upon testing it, however, I found that it employs third-party cookies; it didn't pass the text I described in this post.

Today I happened to find that AppSheet seems to have backed up all of these images of mine.  Inside my app (when viewed in my browser), if I right-click on the image and choose "Copy Image Address" I get this:

https://www.appsheet.com/image/getremoteimageurl?url=https%3A%2F%2Fkanji.askbox.net%2Fimg%2F%E4%B8%8...

Further, when I open the image in a separate tab of my browser, this is the URL:

https://lh3.googleusercontent.com/-jwZCeAoUo4xChBDwBKFikac9Lu63_TO5IuGHsfPq3MSbgKRgwsQ-HwumUyo3uM=w6...

Happily, this URL passes the third-party cookie test.  It seems that AppSheet has backup all of the images to Google Photos and those photos have URLs that do not have third-party cookies.

So, if you have images that were originally from an third party and have third party cookies, it's possible to get the Google Photo urls for them directly from the images in your app.  ๐Ÿ™‚ But, beware that the backups are not made instantly.  It may take a few days after you add an image URL to an image column for this trick to work.

 

Could this be the same reason that has caused inconsistency in this community?

Screenshot 2024-01-15 at 10.37.28โ€ฏPM.png

Thanks but I'm not sure I understand what you mean.

Top Labels in this Space