Join the Webstudio community

Updated last year

Is it possible to add costom Javascript to every single Webstudio page?

At a glance

The community member uses Firebase for their webstudio projects and wonders if they can add the Firebase code to all their websites. The comments suggest that the Firebase configuration code needs to be added individually to each site, but the community member can add the script to the project settings to cover the entire site. They can also add the script to each page using the "HTML Embed" component, or create a "slot" component with the script and paste it on multiple pages. The site settings also have a global HTML embed option.

I use Firebase for almost all my webstudio projects and I am wondering if I can add the Firebase code to all my websites:
Z
J
O
5 comments
Code: // For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
};
I think you'd need to add that code to each site individually.

However, you can add the script to the project settings > custom code to cover your entire site.
Sorry I meant page not website, so I can add javascript to every single page?
Yes. Just use the "HTML Embed" component. If you want the exact same script on multiple pages, I'd add it to a "slot" component and paste that on each page.
Attachment
Screenshot_2024-01-09_at_4.43.54_PM.png
site settings have global html embed
Add a reply
Sign up and join the conversation on Discord