Skip to content

Commit

Permalink
chore: Update npm dependencies and add @astrojs/partytown for Google …
Browse files Browse the repository at this point in the history
…Analytics tracking
  • Loading branch information
RND332 committed Jun 16, 2024
1 parent 2025c33 commit bcf9218
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
14 changes: 13 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ import { shield } from '@kindspells/astro-shield';
import sitemap from "@astrojs/sitemap";
import playformCompress from "@playform/compress";

import partytown from "@astrojs/partytown";

// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), mdx(), sitemap(), shield({}), playformCompress()],
integrations: [
tailwind(),
mdx(),
sitemap(),
shield({}),
playformCompress(),
partytown({
config: {
forward: ["dataLayer.push"],
},
})],
site: 'https://rnd332.com',
build: {
inlineStylesheets: 'always'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/mdx": "^3.1.0",
"@astrojs/partytown": "^2.1.1",
"@astrojs/react": "^3.4.0",
"@astrojs/sitemap": "^3.1.5",
"@astrojs/tailwind": "^5.1.0",
Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const pages: Array<Page> = [
<ViewTransitions />
</head>
<!-- Google tag (gtag.js) -->
<script is:inline async src="https://www.googletagmanager.com/gtag/js?id=G-VSD6GSYPH2" crossorigin="anonymous"></script>
<script is:inline type="module">
<script is:inline type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-VSD6GSYPH2" crossorigin="anonymous" integrity="sha256-qYiLo0cdNGfiDZoKmLxVFIfrl5RsVuOVzzAivA2hHLo="></script>
<script is:inline type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
Expand Down

0 comments on commit bcf9218

Please sign in to comment.