Features Pricing GDPR cookie banner Google Consent Mode v2 WordPress plugin Cookiebot alternative For Agencies GDPR ePrivacy About Contact
RO | EN
Start Free →
Statistics

_pk_ref Cookie (Matomo) – What It Is and Its Purpose

_pk_ref is a cookie set by Matomo (formerly Piwik), a web analytics platform, to remember where a visitor came from (search engine, another website, or a campaign). Its full name includes a site identifier, for example _pk_ref.1. It is used strictly for statistical purposes, not for targeted advertising.

Name
_pk_ref…
Provider
Matomo
Category
Statistics
Type
HTTP cookie
Lifetime
6 months
Consent
Yes, before it is set (GDPR / ePrivacy)

What is the _pk_ref cookie?

_pk_ref is an HTTP cookie created by the Matomo tracking script, an open-source web analytics platform used either as a cloud service (Matomo Cloud) or self-hosted directly on the website owner's server. Because of this, the cookie can appear as first-party (set by the visited domain) or, less commonly, on a dedicated analytics subdomain.

It is created automatically on the first visit, as soon as the Matomo script loads and registers the session, regardless of whether the visitor interacts with the page.

What data it stores

The cookie stores information about the traffic source: whether the visitor arrived via a search engine, a link from another site, a social network, or directly (no referrer), plus the search keyword used, when available. The value is a string encoded internally by Matomo, specific to each site's implementation, and does not contain directly identifying data such as a name or email address.

The data is sent to the Matomo server used by the site (Matomo Cloud or the site owner's own server), not to a default external third party, which sets Matomo apart from some other analytics solutions.

What it is used for

The main purpose is traffic attribution: the site administrator can see in Matomo reports how many visitors come from organic search, paid campaigns, social media, or other websites, and how these sources change over time.

This information helps assess the effectiveness of marketing channels and content, without the detailed individual profiling typical of behavioral advertising.

Does it require consent?

In CookieFix's classification, _pk_ref falls under the statistics category. Under the ePrivacy rules (transposed in Romania via Law 506/2004) and GDPR, analytics cookies are not strictly necessary for the site to function, so they require the visitor's prior consent before being set, except in rare cases where Matomo is explicitly configured in a recognized fully anonymized mode (a setup the administrator must verify, not assume).

  • The site administrator must list this cookie in the cookie policy, including the provider (Matomo) and its duration.
  • The Matomo script must load only after consent is given, not before.
  • If the site uses Matomo Cloud, it is worth noting this in the data transfer information, if the servers are located outside the EEA.

How to block or delete _pk_ref

A visitor can delete or block _pk_ref through browser cookie settings (per-site cookie management) or by using private browsing mode. Matomo also offers a dedicated opt-out feature, if the site administrator enables it.

At the site level, the Matomo script should be blocked automatically until consent is given. A CMP such as CookieFix can handle this automatically, preventing the tracking script from loading before the visitor makes a choice in the consent banner.

Frequently asked questions

No, it does not contain sensitive data; it only stores the traffic source (search, another site, direct) and possibly the search keyword, for statistical purposes.

The number or string after _pk_ref is an internal site identifier (siteId) configured in the Matomo installation, which differs from one site to another.

Generally yes, since it is a statistics cookie and not strictly necessary; a consent banner should be shown before it is set, with rare, explicitly configured exceptions.

No, it is the functional equivalent of GA cookies (like _ga), but belongs to Matomo, which can be self-hosted, giving administrators greater control over the data.

Updated 7 September 2026 · Information comes from the provider’s public documentation and CookieFix scans; it is not legal advice.