Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to enabe Google Analytics #308

Closed
danksky opened this issue Nov 24, 2020 · 2 comments
Closed

Unable to enabe Google Analytics #308

danksky opened this issue Nov 24, 2020 · 2 comments

Comments

@danksky
Copy link

danksky commented Nov 24, 2020

I've followed both of the following tutorials:

https://www.jamify.org/2020/07/15/running-a-professional-blog-for-free
https://ghost.org/integrations/google/

However, whatever I add to the Header through code injection doesn't get included in the actual build even after running

yarn clean
yarn build
gatsby serve
@yoshinator
Copy link

yoshinator commented Jan 3, 2021

I think that is a wider issue and not something particular to this template. I recommend you follow this issue to get updates on when it will be fixed. #22

For now what I ended up doing which might or might not be the right thing to do is to add a new script tag inside of the helmet component and put my analytics snippet there.

...    

    return (
        <>
            <Helmet>
                <html lang={site.lang} />
                    <script async src="https://www.googletagmanager.com/gtag/js?id=YOUR-TAG-ID"></script>
     
                <style type="text/css">{`${site.codeinjection_styles}`}</style>
                <body className={bodyClass} />
            </Helmet>
...

@aileen
Copy link
Member

aileen commented Jan 21, 2021

Closing as it's tracked w/ #22 and the cause of the issue.

@aileen aileen closed this as completed Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants