Astro Analytics

If you're a fan of astronomical references, you'll love integrating Proxima Analytics with your Astro project. Here's how to get started:

Installation

  1. To begin, you'll need to obtain your Website identifier from the Proxima Dashboard. This will allow you to track data on your Astro website using Proxima Analytics.
  2. Next, you can simply add the Proxima analytics script to your Astro project. In Astro, layouts are used for sharing reusable UI structure across pages, so you can add the Proxima script along with the is:inline directive. This will allow you to easily track traffic and engagement data on your Astro website using Proxima Analytics.
src/layouts/BaseLayout.astro
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My Astro Site</title>
    <script
      is:inline
      defer
      src="https://buzz.proxima.so/script.js"
      data-site="XXXX"></script>
  </head>
  <body>
    <slot />
  </body>
</html>

Single Page Applications

If you are using Astro as a Single Page Application along with astro-spa Proxima analytics will also work out of the box, our monitoring script will automatically detect the URL changes.

src/layouts/SpaLayout.astro
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My Astro Site</title>
    <script
      is:inline
      defer
      src="https://buzz.proxima.so/script.js"
      data-site="XXXX"></script>
  </head>
  <body>
    <slot />
  </body>
</html>

With just a few simple steps, you can easily integrate Proxima Analytics with your Astro website. If you have any questions or need further assistance, don't hesitate to reach out to us.