Installation

Astro Install Guide

Statcounter provides customisable hit counters, visitor tracking, web analytics and website stats for Astro.

  1. Sign up for an account at Statcounter to get your code.

    These instructions will be repeated after you've created an account and added your first project.

    Already a member?

  2. Package npmjs page : npmjs.com/package/@statcounter/astro
    Video install guide : youtube.com/watch?v=pguTbTRWLqk


  3. Installation

    npm install @statcounter/astro

  4. Update your Layout.astro file and add this at the top with your other imports

    import { Statcounter } from '@statcounter/astro';

    then add the <Statcounter /> component inside your layout just before the closing tag.

    <Statcounter sc_project={} sc_security="" />

  5. Rebuild the site and restart the app

Get Started

Sign up for a Statcounter account using our Astro installation guide.

Try it for FREE!

Already a Member?

You can reinstall Astro on your Statcounter project.


Installation Guides A - Z

Didn't find your answer here?

Our support team is here to help you!

Contact Support
webf001
23.980140686035