What is the _pk_testcookie cookie?
_pk_testcookie is set by the Matomo (formerly Piwik) tracking script, an open-source web analytics platform commonly used as an alternative to Google Analytics, either self-hosted or via cloud services such as Matomo Cloud.
The cookie appears the first time a page loads with the Matomo tracking code active, before Matomo sets its main tracking cookies (e.g. _pk_id, _pk_ses). Its purpose is purely technical: Matomo creates and deletes it almost immediately, within the same request, simply to confirm that the browser allows cookies to be written.
What data it stores
The stored value is minimal and does not personally identify the visitor — typically a temporary test marker, unrelated to any persistent user or session ID. The cookie is created and removed almost instantly by Matomo's client-side JavaScript, directly in the browser, and is not normally sent to the server as meaningful data.
Being a test cookie, it does not carry behavioral data, page views, or device information — that role belongs to Matomo's main tracking cookies, which are set afterward if allowed.
What it is used for
For the provider (Matomo), this cookie's role is to confirm, before actual data collection starts, that the visitor's browser accepts cookies. If the test fails, Matomo can adjust its tracking method, for instance falling back to cookieless tracking where that option is configured.
For the website operator, this cookie has no standalone use beyond being part of the correct initialization of the Matomo analytics tool, which is used to measure site traffic and visitor behavior.
Does it require consent?
Under CookieFix's classification, _pk_testcookie falls under the statistics category. Even though it's a technical test cookie that doesn't itself store tracking data, it's generated by an analytics tool whose core function requires prior consent under the ePrivacy Directive (transposed in Romania via Law no. 506/2004) and the GDPR.
Website operators should list this cookie in their cookie policy and ensure the Matomo script (and therefore this cookie) does not load before the visitor has given consent for the statistics category, unless Matomo is explicitly configured for anonymized, cookieless analytics.
How to block or delete _pk_testcookie
A visitor can manually delete or block this cookie through their browser's cookie and site data settings (Chrome, Firefox, Edge, Safari). Since it's a session cookie, it's also cleared automatically when the browser closes.
For website operators, the correct approach isn't manual deletion but preventing the Matomo script from loading before consent is given. A CMP such as CookieFix can automatically block the Matomo tracking script (and thus the setting of _pk_testcookie) until the visitor accepts the statistics category in the consent banner.
Frequently asked questions
It's a short-lived cookie used by Matomo to check whether a visitor's browser accepts cookies, before actual traffic tracking begins.
Not directly — it doesn't contain a persistent tracking identifier; it only tests technical cookie support, while actual tracking happens through other Matomo cookies like _pk_id.
Yes, since it's part of an analytics tool's cookie set (statistics category), which requires prior consent under the GDPR and ePrivacy rules, except in cookieless Matomo configurations.
The most effective way is to use a consent management platform (CMP) that automatically blocks the Matomo script until the visitor consents to the statistics category, rather than trying to remove the cookie manually.