Skip to content

Commit

Permalink
Add Analytics (#46)
Browse files Browse the repository at this point in the history
* Try this

* Finish tags
  • Loading branch information
0xKiwi authored Jan 15, 2024
1 parent d230bbd commit dc344dc
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
10 changes: 9 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { defineConfig } from "astro/config";
import partytown from '@astrojs/partytown'

import react from "@astrojs/react";

// https://astro.build/config
export default defineConfig({
integrations: [react()]
integrations: [
react(),
partytown({
config: {
forward: ["dataLayer.push"],
},
})
]
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/partytown": "^2.0.3",
"@astrojs/react": "^2.1.3",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
Expand Down
12 changes: 12 additions & 0 deletions src/pages/gallery.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import Header from "../components/Header";
import DerivativesComponent from "../components/Derivatives";
---

<head>
<!-- Google tag (gtag.js) -->
<script type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-7M9FKP2465"></script>
<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-7M9FKP2465');
</script>
</head>

<Layout title="uwucrew: browse anime artists from all around the world 🎨">
<main>
<Header client:load />
Expand Down
12 changes: 12 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ import Blog from "../components/Blog";
import Community from "../components/Community";
---

<head>
<!-- Google tag (gtag.js) -->
<script type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-7M9FKP2465"></script>
<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-7M9FKP2465');
</script>
</head>

<Layout title="uwucrew: the future of anime art ✨">
<main>
<Hero client:load />
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
unist-util-visit "^4.1.0"
vfile "^5.3.2"

"@astrojs/partytown@^2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@astrojs/partytown/-/partytown-2.0.3.tgz#ae23536d77c896b14d798e346e11f91d170060a2"
integrity sha512-N7bQUxr4TQJKFiOnAr2cvvK9OrCWz2PwsTPTnGr9tRn+f3WCQN4jed9BB4yw9WdWcitYc/N2ECW7u09cg93tgg==
dependencies:
"@builder.io/partytown" "^0.8.0"
mrmime "^1.0.1"

"@astrojs/prism@^2.1.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@astrojs/prism/-/prism-2.1.1.tgz#5f6ae1ab5b630889a8850ba2c991888ed92a3c7a"
Expand Down Expand Up @@ -300,6 +308,11 @@
"@babel/helper-validator-identifier" "^7.19.1"
to-fast-properties "^2.0.0"

"@builder.io/partytown@^0.8.0":
version "0.8.2"
resolved "https://registry.yarnpkg.com/@builder.io/partytown/-/partytown-0.8.2.tgz#bd3689aac3965d7dc05e56c1bb0ef357fdd1d0b0"
integrity sha512-WKGE+SO0qUGirW8J+xOWkHeCkfFEoPPvHnFkcdMl+MY3kDbAcTwjZCzjg27JCvoD0h8fH47FR7DSIss0/S5lyg==

"@emmetio/abbreviation@^2.3.3":
version "2.3.3"
resolved "https://registry.yarnpkg.com/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz#ed2b88fe37b972292d6026c7c540aaf887cecb6e"
Expand Down Expand Up @@ -2145,6 +2158,11 @@ mri@^1.1.0:
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==

mrmime@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27"
integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==

ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
Expand Down

0 comments on commit dc344dc

Please sign in to comment.