Astro
Add Reignat analytics to your Astro site.
Via layout
Add the script to your base layout file (e.g. src/layouts/Layout.astro):
src/layouts/Layout.astro
---// Layout.astro--- <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <slot name="head" /> </head> <body> <slot /> <script is:inline src="https://www.reignat.com/tracker.js" data-site="your-project-id" defer ></script> </body></html>---// Layout.astro--- <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <slot name="head" /> </head> <body> <slot /> <script is:inline src="https://www.reignat.com/tracker.js" data-site="your-project-id" defer ></script> </body></html>✦
Use
is:inline to prevent Astro from bundling the tracker; it should load as a plain external script.Via Head tag
If you use Astro's <head> directly in pages, add the script there:
src/pages/index.astro
---// index.astro--- <html lang="en"> <head> <meta charset="UTF-8" /> <script is:inline src="https://www.reignat.com/tracker.js" data-site="your-project-id" defer ></script> </head> <body> <h1>Hello Astro</h1> </body></html>---// index.astro--- <html lang="en"> <head> <meta charset="UTF-8" /> <script is:inline src="https://www.reignat.com/tracker.js" data-site="your-project-id" defer ></script> </head> <body> <h1>Hello Astro</h1> </body></html>Verify
Deploy and open your site in a browser. Your Reignat dashboard should show a pageview within seconds.
ℹ
Reignat ignores
localhost automatically. Test on your deployed URL.