Pirsch Analytics

Setup

Complete these steps to add Pirsch Analytics to your website. Simple like that.

1

Step 1

Create a new site on Pirsch.

2

Step 2

Some browsers and ad-blockers might block the requests to the Pirsch JavaScript file. To fix this, Launch Express automatically includes a rule in next.config.js that redirects requests to the correct file. This rule is already set up, so you don’t need to do anything.

next.config.mjs
async rewrites() {
  return [
    {
      source: "/pa.js",
      destination: "https://api.pirsch.io/pa.js",
    },
  ];
},
3

Step 3

Get insights into your website traffic with Pirsch Analytics. You can copy the tracking script from the dashboard and add it to your website. Paste the script in the <head> tag of the layout.tsx file of your website.

app/layout.tsx
<head>
  <link rel="icon" href="/favicon.ico" sizes="any" />
  {/* Place here your Analytics script */}
  <!-- the script looks like the following: -->
  <script defer src="/pa.js" id="pianjs" data-code="YOUR_IDENTIFICATION_CODE"></script>
</head>
...

Events

Pirsch lets you track specific events on your webpage. Check the documentation for more details.

After Adding the Script

After adding the script, you can view the analytics in the dashboard. You can see the number of visitors, page views, and referrers. You can also see the number of visitors per country and the most visited pages.

If you need more analytics documentations or have any questions, feel free to ask in the Discord community or contact us here.