mirror of
https://github.com/sammyshear/sshear.dev.git
synced 2025-12-06 03:15:53 +00:00
google adsense
This commit is contained in:
parent
a729386a92
commit
2b2745d669
@ -1,23 +1,25 @@
|
|||||||
---
|
---
|
||||||
type Props = { measurementId: string }
|
type Props = { measurementId: string };
|
||||||
const props = Astro.props as Props
|
const props = Astro.props as Props;
|
||||||
const measurementId = props.measurementId
|
const measurementId = props.measurementId;
|
||||||
---
|
---
|
||||||
|
|
||||||
<script
|
<script
|
||||||
type='text/partytown'
|
type="text/partytown"
|
||||||
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}></script>
|
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}
|
||||||
|
></script>
|
||||||
<script
|
<script
|
||||||
type='text/partytown'
|
type="text/partytown"
|
||||||
data-ga-measurement-id={measurementId}
|
data-ga-measurement-id={measurementId}
|
||||||
id='ga-init'
|
id="ga-init"
|
||||||
>
|
>
|
||||||
const measurementId = document
|
const measurementId = document
|
||||||
.getElementById('ga-init')
|
.getElementById("ga-init")
|
||||||
.getAttribute('data-ga-measurement-id')
|
.getAttribute("data-ga-measurement-id");
|
||||||
window.dataLayer = window.dataLayer || []
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag() {
|
function gtag() {
|
||||||
dataLayer.push(arguments) // eslint-disable-line
|
dataLayer.push(arguments); // eslint-disable-line
|
||||||
}
|
}
|
||||||
gtag('js', new Date())
|
gtag("js", new Date());
|
||||||
gtag('config', measurementId)
|
gtag("config", measurementId);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -25,15 +25,13 @@ const {
|
|||||||
<meta name="author" content={author} />
|
<meta name="author" content={author} />
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||||
|
<meta name="google-adsense-account" content="ca-pub-2655673927481085" />
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
class="flex flex-col place-items-center bg-ctp-base ctp-latte text-ctp-text dark:ctp-mocha"
|
class="flex flex-col place-items-center bg-ctp-base ctp-latte text-ctp-text dark:ctp-mocha"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
<style is:global>
|
<style is:global>
|
||||||
html.dark .astro-code,
|
html.dark .astro-code,
|
||||||
html.dark .astro-code span {
|
html.dark .astro-code span {
|
||||||
@ -67,3 +65,5 @@ const {
|
|||||||
}
|
}
|
||||||
window.localStorage.setItem("theme", theme);
|
window.localStorage.setItem("theme", theme);
|
||||||
</script>
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user