Adding Pirsch to Your Website
After you created an account, you can add Pirsch to your website.
- Open the dashboard and click on Add Domain in the menu.
- Enter the hostname of your website (such as example.com) and select a subdomain and time zone you wish to use for the Pirsch dashboard.
- Click on Add Domain.
<head>section of your website.
And you're done! Your website is now sending page views to Pirsch. Note that only page views for the hostname you enter will be accepted. A pageview for sub.example.com won't be accepted if you've configured example.com. They are considered completely different websites and you will need to add a new dashboard or additional domain for them. The only exception to this is
www in front of your top level domain. For example,
www.example.com will be accepted for
example.com and vice versa.
Testing the Integration
To test the script, navigate to your website and open the Network tab of the developer tools in your browser (usually F12 or
Ctrl/Command + Shift + I). Search for 'hit' and make sure you get a 200 response code in the status column.
If you don't, check your identification code and the domain you configured. Also, make sure you don't send the Do Not Track (DNT) HTTP header or set the
disable_pirsch option in your local cache, as the hit will be ignored. Adblockers will also block our script.
If you still do not see the request go through, please contact our support.
Resetting the Identification Code
Including or Excluding Pages
The snippet provides a very flexible way of including or excluding pages. You can exclude one or more pages by specifying the
data-exclude attribute. The content is a list of regular expressions used to filter pages.
This example will match the page
/exact/match and any page starting with
Please always validate your expressions before using them and make sure you don't see any errors in the browser console. Special regex characters must be escaped. For a simple single page filter use a pattern like
data-include can be used to whitelist pages. In the case of whitelisting, only pages that match a pattern in the list will send a page view. The blacklist still applies.
Disabling Certain Features
It's possible to disable certain features of the script. Disabling a feature will prevent the data from being sent to Pirsch. To disable a feature, simply add an attribute to the script tag.
data-disable-querywill remove all query parameters from the URL, including UTM parameters.
data-disable-refererremoves the referer
data-disable-resolutionremoves the screen resolution (width and height).
Here is an example:
Ignoring Your Own Page Views
You can disable this integration by setting the DNT (Do Not Track) header to
1 in your browser, or by adding a value called
disable_pirsch to your local storage.
For the latter option, open the developer tools (usually F12 or
Ctrl + Shift + I) in your browser and navigate to the web storage tab. Click on local storage and add a new value
1 as the value. After reloading the page, no page views or events (if you also use the event script) should be sent to Pirsch.
Testing Pirsch Locally
The scripts will ignore any requests made on localhost. If you want to override this behaviour, e.g. for testing, you can add the
data-dev attribute. The host names must match. If you are testing on localhost, rewrite the hostname with the
data-dev attribute like this
In this case, the hostname you've configured on the Dashboard is
example.com. So you need to add
data-dev="example.com" to rewrite the hostname.