gtag fix
This commit is contained in:
parent
9f4dd67156
commit
d171e96a7e
2 changed files with 15 additions and 18 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Script } from "gatsby";
|
||||||
import { useSiteMetadata } from "../hooks/use-site-metadata";
|
import { useSiteMetadata } from "../hooks/use-site-metadata";
|
||||||
|
|
||||||
export const Seo = ({ title, description, pathname, children }) => {
|
export const Seo = ({ title, description, pathname, children }) => {
|
||||||
|
|
@ -19,6 +20,19 @@ export const Seo = ({ title, description, pathname, children }) => {
|
||||||
<title>{seo.title}</title>
|
<title>{seo.title}</title>
|
||||||
<meta name="description" content={seo.description} />
|
<meta name="description" content={seo.description} />
|
||||||
<meta name="image" content={seo.image} />
|
<meta name="image" content={seo.image} />
|
||||||
|
<Script
|
||||||
|
async
|
||||||
|
src="https://www.googletagmanager.com/gtag/js?id=G-8M9CZ79T4L"
|
||||||
|
></Script>
|
||||||
|
<Script>
|
||||||
|
{`
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'G-8M9CZ79T4L');
|
||||||
|
`}
|
||||||
|
</Script>
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -12,21 +12,4 @@ const IndexPage = () => {
|
||||||
|
|
||||||
export default IndexPage;
|
export default IndexPage;
|
||||||
|
|
||||||
export const Head = () => (
|
export const Head = () => <Seo title="MID Creative" />;
|
||||||
<>
|
|
||||||
<Seo title="MID Creative" />;
|
|
||||||
<Script
|
|
||||||
async
|
|
||||||
src="https://www.googletagmanager.com/gtag/js?id=G-8M9CZ79T4L"
|
|
||||||
></Script>
|
|
||||||
<Script>
|
|
||||||
{`
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
|
|
||||||
gtag('config', 'G-8M9CZ79T4L');
|
|
||||||
`}
|
|
||||||
</Script>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue