Skip to content

Commit

Permalink
chore: Add Google Analytics tracking code to Layout.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
RND332 committed Jun 14, 2024
1 parent 0979fab commit d96f99e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ const pages: Array<Page> = [
<!doctype html>
<html lang="en" class="sd:text-xs md:text-base lg:text-xl xl:text-3xl">
<head>
<script
is:inline
src="https://www.googletagmanager.com/gtag/js?id=G-VSD6GSYPH2"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-VSD6GSYPH2");
</script>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
Expand Down Expand Up @@ -42,7 +55,8 @@ const pages: Array<Page> = [
{
pages.map((page, index) => {
// case for index page
const currentPageId = currentPage == undefined ? "who" : currentPage;
const currentPageId =
currentPage == undefined ? "who" : currentPage;
const isCurrentPage = currentPageId === page.id;

let styles = "px-2 ";
Expand Down

0 comments on commit d96f99e

Please sign in to comment.