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

Where should I put this script? #874

Open
rkretch91 opened this issue Mar 16, 2024 · 1 comment
Open

Where should I put this script? #874

rkretch91 opened this issue Mar 16, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@rkretch91
Copy link

Hi there,

I am trying to put a script into my blog:

<script data-grow-initializer="">!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement("script");(e.type="text/javascript"),(e.src="https://faves.grow.me/main.js"),(e.defer=!0),e.setAttribute("data-grow-faves-site-id","dfsdfsdf=");var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);})();</script>

I previously would put this in _document.js, but this is no longer available. I have tried layout.tsx but it is not registering the script even though I see it in the head.

Any help is much appreciated <3

@rkretch91 rkretch91 added the bug Something isn't working label Mar 16, 2024
@timlrx
Copy link
Owner

timlrx commented Apr 17, 2024

You can set it as an inline script in layout.tsx i.e. https://nextjs.org/docs/pages/building-your-application/optimizing/scripts#inline-scripts

@timlrx timlrx added help wanted Extra attention is needed and removed bug Something isn't working labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants