Skip to content

Commit

Permalink
add ga.js (#3022)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpryan committed Jun 29, 2024
1 parent 982fc35 commit c593c6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/dartpad_ui/web/ga.js
Original file line number Diff line number Diff line change
@@ -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');
1 change: 1 addition & 0 deletions pkgs/dartpad_ui/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<link href="styles/cm-dartpad-dark.css" rel="stylesheet" media="screen">
<link href="styles/cm-dartpad-light.css" rel="stylesheet" media="screen">
<script src="codemirror/codemirror.js"></script>
<script src="scripts/ga.js" defer></script>

<style>
.CodeMirror {
Expand Down

0 comments on commit c593c6f

Please sign in to comment.