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•3w ago
what did you try?
vicious-goldOP•3w 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•3w ago
children
would the content
we have a component called ScriptOnce
that should do what you need as wellvicious-goldOP•3w 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•3w ago
what about that?
vicious-goldOP•3w ago
I guess i can just add a noscript tag nvm.