Skip to content

Commit

Permalink
Merge pull request #5 from jiaulislam/m1-work
Browse files Browse the repository at this point in the history
✨ adding google analytics
  • Loading branch information
jiaulislam authored Oct 12, 2024
2 parents 9fd8c5f + e2bf3ba commit d8d2725
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
7 changes: 6 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import sitemap from '@astrojs/partytown';

import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
site: 'https://jiaulislam.dev/',
integrations: [mdx(), sitemap(), tailwind()],
integrations: [mdx(), sitemap(), tailwind(), partytown({
config: {
forward: ["dataLayer.push"]
}
})],
"plugins": [
{
"name": "@astrojs/ts-plugin"
Expand Down
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"dependencies": {
"@astrojs/mdx": "^0.11.1",
"@astrojs/partytown": "^2.1.2",
"@astrojs/rss": "^1.0.1",
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^3.0.0",
Expand Down
21 changes: 19 additions & 2 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,29 @@ import SideBar from "../components/SideBar.astro";
import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
const { image, title = SITE_TITLE, description = SITE_DESCRIPTION, includeSidebar = true } = Astro.props;
const {
image,
title = SITE_TITLE,
description = SITE_DESCRIPTION,
includeSidebar = true,
} = Astro.props;
---

<!DOCTYPE html>
<!doctype html>
<html lang="en" data-theme="lofi">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VZJYL0HKRT"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-VZJYL0HKRT");
</script>
<BaseHead title={title} description={description} image={image} />
</head>
<body>
Expand Down

0 comments on commit d8d2725

Please sign in to comment.