Is there a _pk_ref cookie like in Matomo

Hi there,

I noticed some of my traffic is losing the ref data and is set to direct. This happens a lot on SPA pages when the user starts a new session in the process.

Is the a similar ref cookie like in Matomo that catches the attribution?

See here: What cookies are created by the Matomo JavaScript Tracking client? FAQ - General - Matomo Analytics Platform

_pk_ref Stores attribution information (the referrer that brought the visitor to the website).

This cookie is stored for 6 months.

I know Piwik Pro has stg_externalReferrer but this one lasts only for the time of the session.

Regards Martin

1 Like

Hello @Martin

List of all the cookies created for visitors can be found in this article:

I don’t think cookies are issue here. This sounds like an issue with loading your tracking code on SPA pages, some additional redirects or how ref variable is visible for analytics on router change. Could you send me here or in private your www address so I can take a brief look at the your website?

I’ve looked into your settings @Martin and I think that it might be linked with logic for consents and two custom tags for tracking Piwik PRO that are in tag manager.

I think you need to check logic there because it might not be tracking correctly after consent is granted with your consent manager.

Hi @jfidala , I am using a custom setting due to the unauthorised setting of piwik cookies, see one of my posts here Piwik sets Cookies without consent stg_ - Privacy - Piwik PRO Community

There is no double tracking etc. The meta data gets lost in our commerce SPA due its loading the sales application. Thats why I asked if there is a Piwik data I can reuse to clear the ref data when its empty vs a known source.