Project import generated by Copybara.

GitOrigin-RevId: d9e9e3fb4e31372ec1fb43b178994ca78fa8fe70
diff --git a/templates/framework/footer.ezt b/templates/framework/footer.ezt
new file mode 100644
index 0000000..963b61d
--- /dev/null
+++ b/templates/framework/footer.ezt
@@ -0,0 +1,42 @@
+</div> [# End <div id="maincol"> from header.ezt]
+
+[include "footer-shared.ezt"]
+
+<script type="text/javascript" nonce="[nonce]">
+// Google Analytics
+(function(i,s,o,g,r,a,m){i[[]'GoogleAnalyticsObject']=r;i[[]r]=i[[]r]||function(){
+(i[[]r].q=i[[]r].q||[[]]).push(arguments)},i[[]r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[[]0];a.async=1;a.setAttribute('nonce','[nonce]');
+a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+(function setupGoogleAnalytics() {
+  const _EMAIL_REGEX =
+      ["/([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})/"];
+
+  ga('create', '[analytics_id]', {'siteSpeedSampleRate': 100});
+
+  [if-any logged_in_user]
+    ga('set', 'dimension1', 'Logged in');
+  [else]
+    ga('set', 'dimension1', 'Not logged in');
+  [end]
+
+  const path = window.location.href.slice(window.location.origin.length);
+  if (path.startsWith('/u')) {
+    [# Keep anything that looks like an email address out of GA.]
+    ga('set', 'title', 'A user page');
+    ga('set', 'location', path.replace(_EMAIL_REGEX, 'user@example.com'));
+  }
+
+  ga('send', 'pageview');
+})();
+</script>
+
+<ezt-app-base [if-any logged_in_user]
+  userDisplayName="[logged_in_user.email]"[end]
+  projectName="[projectname]"
+></ezt-app-base>
+
+</body>
+</html>