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