PHPackages                             sstottelaar/pirsch-statamic-addon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sstottelaar/pirsch-statamic-addon

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sstottelaar/pirsch-statamic-addon
=================================

1.5(5mo ago)1122MITPHP

Since Apr 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/sstottelaar/pirsch-statamic-addon)[ Packagist](https://packagist.org/packages/sstottelaar/pirsch-statamic-addon)[ RSS](/packages/sstottelaar-pirsch-statamic-addon/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Pirsch Statamic Addon
=====================

[](#pirsch-statamic-addon)

> Seamlessly integrate Pirsch Analytics into your Statamic site with a focus on privacy and server-side tracking.

Features
--------

[](#features)

- **Server-Side Tracking:** integrates Pirsch easily without client-side Javascript for basic pageview tracking. This enhances user privacy and prevents adblockers from interfering
- **Automatic Filtering:** automatically excludes visits from your local development environment (configurable)
- **Antlers Tags:** provides simple Antlers tags for easy custom event tracking directly from your templates
- **Dashboard Link**: easy access to the Pirsch dashboard directly from the CP

Requirements
------------

[](#requirements)

- Statamic v5 / v6
- PHP 8.2+
- A Pirsch account

Installation
------------

[](#installation)

1. Install the addon using Composer:

    ```
    composer require sstottelaar/pirsch-statamic-addon
    ```
2. **(Optional)** Publish the configuration file if you need to customize default settings (like excluded domains):

    ```
    php please vendor:publish --tag="pirsch-config"
    ```

    This creates a `config/pirsch.php` file. Using `.env` variables is generally preferred for credentials.

Configuration
-------------

[](#configuration)

1. **Get your Pirsch Access Key:**

    - Log in to your Pirsch dashboard.
    - Go to **Settings** -&gt; **Integration**.
    - Ensure the correct domain/website is selected (top right).
    - Scroll down to the "Clients" section and click **Add Client**.
    - Select the **Access Key (write-only)** type.
    - Give the client a descriptive name (e.g., "Statamic Production Site").
    - Copy the generated **Client Secret** (this is your token).
2. **Add the Token to your Environment:**Open your `.env` file and add the copied token:

    ```
    PIRSCH_TOKEN=pa_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    ```

    - **Important:** Make sure to add this variable to your production `.env` file as well.
    - **Tip:** Leave the `PIRSCH_TOKEN` variable empty or unset in non-production environments (like local or staging) to automatically disable tracking there.

How it Works
------------

[](#how-it-works)

Once installed and configured with a valid `PIRSCH_TOKEN`, the addon automatically starts tracking pageviews on every request using Pirsch's server-side tracking capabilities. No further setup is needed for basic tracking.

This addon handles pageviews server-side, eliminating the need for the Pirsch JavaScript snippet for core tracking. Manually add the snippet only if you specifically require client-side event tracking via JavaScript.

Usage
-----

[](#usage)

### Basic Pageview Tracking

[](#basic-pageview-tracking)

Automatic, no action required after configuration.

### Event Tracking (Antlers)

[](#event-tracking-antlers)

Use the provided Antlers tag in your templates to track custom events:

```
{{ pirsch:event name="Contact form submitted" }}
```

Example with meta data:

```
{{ pirsch:event name="Contact form submitted" \metadata='{"form": "contact"}' }}
```

> Never send Personally Identifiable Information (PII) or any sensitive user-specific data in the event metadata. You are responsible for ensuring compliance with privacy regulations (like GDPR). Use the metadata feature cautiously and at your own risk. For best practices, consult the [Pirsch Event Documentation](https://docs.pirsch.io/advanced/events).

### Dashboard link

[](#dashboard-link)

Pirsch has the ability to create access links. To create an access link:

1. Log in to your Pirsch dashboard.
2. Go to **Settings** -&gt; **Access**.
3. Scroll down to the **Access Links** section
4. Add a new access link and copy the link
5. Open your `.env` file and the follow: ```
    PIRSCH_DASHBOARD_URL="https://xxxxx.pirsch.io/?access=xxxxxxxxxxxxxxxxxxxx"
    ```

Roadmap
-------

[](#roadmap)

- Enhance event tracking capabilities (e.g., duration)
- Add a convenient link in the CP to navigate to your Pirsch Dashboard
- Display Pirsch statistics directly in the Statamic Control Panel

Issues
------

[](#issues)

If you experience any issues, please make a GitHub issue or contact me at [sjoerdstottelaar.nl](https://www.sjoerdstottelaar.nl)

Contributing
------------

[](#contributing)

Contributions are welcome! Please create an issue or submit a pull request.

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance73

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~73 days

Total

7

Last Release

152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44e7034ff84134078d014422ce0489f8bfd2e0a90be4eb58a494f4b34717c229?d=identicon)[sstottelaar](/maintainers/sstottelaar)

---

Top Contributors

[![sstottelaar](https://avatars.githubusercontent.com/u/11455085?v=4)](https://github.com/sstottelaar "sstottelaar (12 commits)")

### Embed Badge

![Health badge](/badges/sstottelaar-pirsch-statamic-addon/health.svg)

```
[![Health](https://phpackages.com/badges/sstottelaar-pirsch-statamic-addon/health.svg)](https://phpackages.com/packages/sstottelaar-pirsch-statamic-addon)
```

###  Alternatives

[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[rias/statamic-redirect

29335.6k](/packages/rias-statamic-redirect)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)[jacksleight/statamic-bard-texstyle

18195.4k](/packages/jacksleight-statamic-bard-texstyle)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k15](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
