mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-11 18:56:06 +09:00
added gtm support
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user