For astroJs we recommend using the web integration by placing the code somewhere in the layout, before the closingDocumentation Index
Fetch the complete documentation index at: https://docs.visitorquery.com/llms.txt
Use this file to discover all available pages before exploring further.
</body> tag. Here is an example:
layout.astro
astro:page-load event to run the script.
This will ensure that the script runs after the page has loaded and triggers a check after each page load.
If you don’t need page views and you want to run the script only once, you can use the window.onload event instead.