Skip to content

Commit

Permalink
partytown added for GTagManager
Browse files Browse the repository at this point in the history
  • Loading branch information
aritraroy24 committed Feb 12, 2024
1 parent 5bbc08f commit 7f24aa4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
6 changes: 4 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ import mdx from '@astrojs/mdx';
import compress from "astro-compress";
import sitemap from "@astrojs/sitemap";
import astroExpressiveCode from 'astro-expressive-code';
import icon from 'astro-icon'
import icon from 'astro-icon';
import partytown from "@astrojs/partytown";

/** @type {import('astro-expressive-code').AstroExpressiveCodeOptions} */
const astroExpressiveCodeOptions = {
// Example: Change the theme to "dracula"
theme: 'min-dark'
};


// https://astro.build/config
export default defineConfig({
site: 'https://aritraroy.live',
integrations: [react(), astroExpressiveCode(astroExpressiveCodeOptions), mdx(), sitemap(), icon(), compress()],
integrations: [react(), astroExpressiveCode(astroExpressiveCodeOptions), mdx(), sitemap(), icon(), partytown(), compress()],
markdown: {
shikiConfig: {
theme: 'min-dark',
Expand Down
29 changes: 29 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 @@ -12,6 +12,7 @@
"dependencies": {
"@astrojs/markdown-remark": "^4.2.1",
"@astrojs/mdx": "^2.1.0",
"@astrojs/partytown": "^2.0.4",
"@astrojs/react": "^3.0.9",
"@astrojs/rss": "^4.0.4",
"@astrojs/sitemap": "^3.0.5",
Expand Down
6 changes: 4 additions & 2 deletions src/components/Meta/GoogleAnalytics.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
import.meta.env.DEV && (
<script
type="text/javascript"
type="text/partytown"
async
src="https://www.googletagmanager.com/gtag/js?id=NOT-PASSED"
is:inline
/>
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
Expand All @@ -19,9 +20,10 @@
{
import.meta.env.PROD && (
<script
type="text/javascript"
type="text/partytown"
async
src="https://www.googletagmanager.com/gtag/js?id=G-ZX7CR53T89"
is:inline
/>
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
Expand Down

0 comments on commit 7f24aa4

Please sign in to comment.