Host Unity Game on Google Sites

I have created a WebGL game that is actually kind of fun, and want to put it on a new Google Site. I know hosting on Google Drive has been taken down, but I feel there must be some way to embed an HTML page on Google Drive in Google Sites. But Google Sites tells me the selected file type is not supported. When I try using a URL embed, it shows the HTML code instead of the page. If I use a direct URL, it tells me a link will be displayed instead of the actual HTML. How do I embed a Unity game in Google Sites?

I have searched for this before, but all the answers either use the deprecated Web Player, old Google Sites, or deprecated Google Drive Hosting.

(I am using NEW Google Sites, not old Google Sites)

Since the new Google Sites stopped supporting gadgets, the best alternative would be to insert a url that can be expanded to a mini preview of sorts. The requirements for that would be

  • Free
  • Customizable
  • Supports: HTML5 (Canvas), Javascript, CSS
  • File Hosting
  • No random overlays/icons/footers
  • Uses HTTPS (since otherwise google won’t let you have a preview)

After trying a few different web hosting services (wordpress, weebly, neocities, etc), I found that Github Pages was by far the best option. Just create a repo named [username].github.io and put your build in it, then link the url to your Google Sites page.

A few modifications to index.html a bit to make it fullscreen:

<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title> Unity WebGL Player | thing </title>
    <link rel="shortcut icon" href="TemplateData/favicon.ico">
    
    <style>
    html {
    	overflow: hidden;
	}

	#gameContainer {
	    height: 100%;
	    width: 100%;
	}
	</style>

    <link rel="stylesheet" href="TemplateData/style.css">
    <script src="TemplateData/UnityProgress.js"></script>  
    <script src="Build/UnityLoader.js"></script>

    <script>
      var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Builds.json", {onProgress: UnityProgress});
    </script>
    
  </head>
  <body>
    <div class="webgl-content">
      <div id="gameContainer"></div>
    </div>
  </body>
</html>

An example

You can now host directly on the Unity Connect site with a public URL…