added gtm support

This commit is contained in:
Somrat
2025-04-28 10:20:07 +06:00
parent de5b943f38
commit 423ad81a1c
3 changed files with 24 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "astroplate",
"version": "5.4.3",
"version": "5.5.0",
"description": "Astro and Tailwindcss boilerplate",
"author": "zeon.studio",
"license": "MIT",
@@ -21,6 +21,7 @@
"@astrojs/react": "4.2.4",
"@astrojs/rss": "4.0.11",
"@astrojs/sitemap": "3.3.0",
"@digi4care/astro-google-tagmanager": "^1.4.0",
"@justinribeiro/lite-youtube": "^1.7.1",
"astro": "5.7.4",
"astro-auto-import": "^0.4.4",
+5
View File
@@ -33,6 +33,11 @@
"link": "https://github.com/zeon-studio/astroplate"
},
"google_tag_manager": {
"enable": false,
"gtm_id": "GTM-XXXXXX"
},
"disqus": {
"enable": true,
"shortname": "themefisher-template",
+17
View File
@@ -6,6 +6,10 @@ import { plainify } from "@/lib/utils/textConverter";
import Footer from "@/partials/Footer.astro";
import Header from "@/partials/Header.astro";
import "@/styles/main.css";
import {
GoogleTagmanager,
GoogleTagmanagerNoscript,
} from "@digi4care/astro-google-tagmanager";
import { AstroFont } from "astro-font";
import { ClientRouter } from "astro:transitions";
import SearchModal from "./helpers/SearchModal";
@@ -44,6 +48,12 @@ const { title, meta_title, description, image, noindex, canonical } =
<!doctype html>
<html lang="en">
<head>
<!-- google tag manager -->
{
config.google_tag_manager.enable && (
<GoogleTagmanager id={config.google_tag_manager.gtm_id} />
)
}
<!-- favicon -->
<link rel="shortcut icon" href={config.site.favicon} />
<!-- theme meta -->
@@ -171,6 +181,13 @@ const { title, meta_title, description, image, noindex, canonical } =
<meta name="twitter:card" content="summary_large_image" />
</head>
<body>
{/* google tag manager noscript */}
{
config.google_tag_manager.enable && (
<GoogleTagmanagerNoscript id={config.google_tag_manager.gtm_id} />
)
}
<TwSizeIndicator />
<Header />
<SearchModal client:load />