diff --git a/pkgs/dartpad_ui/web/ga.js b/pkgs/dartpad_ui/web/ga.js
new file mode 100644
index 000000000..607cb1acf
--- /dev/null
+++ b/pkgs/dartpad_ui/web/ga.js
@@ -0,0 +1,11 @@
+(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.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ga('create', 'UA-26406144-18', {
+ cookieFlags: 'secure;samesite=none',
+ cookieDomain: 'auto'
+});
+ga('set', 'referrer', document.referrer.split('?')[0]);
+ga('send', 'pageview');
\ No newline at end of file
diff --git a/pkgs/dartpad_ui/web/index.html b/pkgs/dartpad_ui/web/index.html
index 649610fac..eb5a05eab 100644
--- a/pkgs/dartpad_ui/web/index.html
+++ b/pkgs/dartpad_ui/web/index.html
@@ -30,6 +30,7 @@
+