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
rotten-yellow•4mo ago
what did you try?
ratty-blushOP•4mo 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
rotten-yellow•4mo ago
children would the content
we have a component called ScriptOnce that should do what you need as wellratty-blushOP•4mo 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?
rotten-yellow•4mo ago
what about that?
ratty-blushOP•4mo ago
I guess i can just add a noscript tag nvm.