Join the Webstudio community

Updated 2 years ago

Hey is there a way to add something to

At a glance

The community members discuss adding code snippets to the <head> tag using a cloud app. One community member suggests using the HTML Embed component in the footer and linking it to every page using a Slot, though this would need to be done for each page. Another community member asks if the Slot is already being used. The original poster mentions they are currently using the Embed element to add GA and G Optimize code, but the recommended approach is to include the snippets in the header. The community members discuss that while the header is recommended, adding the snippets to the footer can be better as it avoids loading the scripts before the content has loaded.

Hey, is there a way to add something to the <head> tag using the cloud app? For adding some code snippets (e.g. GA / GTM)
O
q
4 comments
Not at the moment but you can add the HTML Embed component on the page e.g. somewhere in the footer

And use a Slot to link it to every page. A bit annoying because you would have to do it for every page, but I bet you have already a footer that is on every page, so it can be added inside of it
Do you already use Slot?
Yeah I'm currently using the embed element to add code snippet for GA and G Optimize, but the recommended is to include the snippets to the header.

I just gave it a try and for reusable purposes Slot would be really handy and useful, even though we cannot add it to the header (which would be nice).
They recommend to put it in the header only because they want to catch visits that are aborted or when there is some blocking script before the footer.

Generally nothing bad to do this from the bottom of the page, it can be even better, because you are not loading their scripts before content has loaded
Add a reply
Sign up and join the conversation on Discord