NPM SDK / Package
1.Site analytics
Use this when your frontend installs dependencies with npm, pnpm, or yarn and you want the snippet loaded from application code.
- Open the site in Studio.
- Open Settings β Site Analytics and copy the Embed snippet values (
src,data-site,data-key). - In your project root, keep the tracker as a deferred script tag (Blogdat ships as a hosted script, not a local package publish).
- Add the snippet once in your root layout or
index.html, immediately before</body>. - Deploy the change.
- Open a public page and confirm a visit in Site Analytics.
Do not mount the script more than once per page load. Keep data-site and data-key tied to the Studio site you are measuring.
2.Blog
- Open the site in Studio and go to Settings β Domain.
- Connect
blog.yourdomain.com. Studio shows the CNAME to add at your DNS host. - Verify the domain in Studio after DNS propagates.
- Link Blog from your app shell to
https://blog.yourdomain.com. - To render posts inside your own UI instead, open Settings β API and use the public list and post endpoints.