Skip to content

Commit

Permalink
Defer ga scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop committed Sep 18, 2022
1 parent 87ef691 commit 4149714
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 6 additions & 0 deletions public/gtag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-15345174-10");
11 changes: 2 additions & 9 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@ const { title } = Astro.props;
<meta name="og:title" content="BEM — Block Element Modifier"/>
<meta name="og:description" content="BEM — Block Element Modifier is a methodology, that helps you to achieve reusable components and code sharing in the front-end."/>

<script src="https://www.googletagmanager.com/gtag/js?id=UA-15345174-10"/>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-15345174-10");
</script>
<script defer src="https://www.googletagmanager.com/gtag/js?id=UA-15345174-10"/>
<script defer src="/gtag.js"/>
</head>
<body>
<div class="flex flex-col min-h-screen overflow-hidden">
Expand Down

1 comment on commit 4149714

@vercel
Copy link

@vercel vercel bot commented on 4149714 Sep 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

getbem-github-io – ./

getbem-github-io-getbem.vercel.app
getbem-github-io-git-master-getbem.vercel.app
getbem-github-io.vercel.app

Please sign in to comment.