Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIWIK Store visits per User ID as well as or instead of per IPs

Tags:

matomo

I have piwik to track my website visits. My website has a login page and I would like to do the analysis per userid, not necessarily per IP. Is there a way where piwik can store my user session variable in order me to know exactly which users used a determined page? Thanks in advance.

like image 694
Jenninha Avatar asked Sep 06 '25 03:09

Jenninha


1 Answers

The way to do this is via custom variable.

Basic Code:

piwikTracker.setCustomVariable(1, "Member", "<?php echo $username;?>", "visit"); piwikTracker.trackPageView();

visit scope will last for the session

Piwik Docs at: http://piwik.org/docs/custom-variables/

like image 139
Adrian Avatar answered Sep 08 '25 00:09

Adrian