T
TanStack3w ago
vicious-gold

Google Tags and scripts

What is the proper way to add google tags and analytics to a site? The scripts in header doesn't seem to like scripts with content in it.
6 Replies
absent-sapphire
absent-sapphire3w ago
what did you try?
vicious-gold
vicious-goldOP3w ago
Well i didnt try to put it in the scripts because i read the keys that are acceptable and there are none for content. So i use a hydrated variable and insert into the layout using dangerously set inner html. Hydrated so that i dont get hydration errors, however this way its not in the html at runtime
absent-sapphire
absent-sapphire3w ago
children would the content we have a component called ScriptOnce that should do what you need as well
vicious-gold
vicious-goldOP3w ago
So children would be a string with the content? Is there documentation on scriptOnce i can't find it Also what about a no script tag?
absent-sapphire
absent-sapphire3w ago
what about that?
vicious-gold
vicious-goldOP3w ago
I guess i can just add a noscript tag nvm.

Did you find this page helpful?