# Astro (https://talivia.com/docs/installation-guides/astro)



Add Talivia to the shared layout used by your Astro pages.




## Add the script [#add-the-script]

Open your base layout, for example `src/layouts/BaseLayout.astro`, and place the snippet before the closing `</body>` tag.

```astro
---
const { title } = Astro.props;
---

<html lang="en">
  <head>
    <title>{title}</title>
  </head>
  <body>
    <slot />
    <script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
  </body>
</html>
```

Replace the website ID. Use the ID from Talivia Settings -> Tracking for this Astro site.

Deploy or run the site, visit a page, and confirm the new session in Talivia.
