Documentation
On this page

Install on Astro

Measure visits to your Astro website using the script from your Jelto product.

Before you start

Register the published hostname in Jelto and copy the complete script from Settings → Installation. You need permission to edit and publish the site. If your platform restricts custom scripts, confirm that your plan provides this feature.

Add the script

  1. Open the shared layout component used by your pages, for example src/layouts/Layout.astro. Paste the tag inside its <head> and add is:inline to keep Astro from bundling it as a module. Keep defer and the product attributes.
  2. Preserve the copied data-product, data-endpoint and src values.
  3. Build and deploy your Astro site.

The tag has this structure; uppercase values below must be replaced with the values from your own dashboard:

<script is:inline defer
  data-product="YOUR_PRODUCT_ID"
  data-endpoint="YOUR_INGEST_ENDPOINT"
  src="YOUR_SCRIPT_URL"></script>

Verify

Open the published homepage in a normal browser, navigate to another page, then use Jelto's Check traffic for the actual hostname. Follow Verify website tracking. For a site with client navigation, check a route change and the Back button as well as a full reload.

Common problems

With client routing, check forward and back navigation on the published site. Do not add data-astro-rerun to reinstall the tracker on each navigation.

If traffic is still missing, check collection troubleshooting. For optional route, exclusion and download settings, use Script configuration.

Platform reference: Official Astro documentation.