New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new dimension and segment "Profilable" (and new column log_visit.profilable) #16217
Conversation
@@ -153,6 +155,10 @@ public function getMigrations(Updater $updater) | |||
$migrations[] = $this->migration->db->sql("UPDATE $visitActionTable SET search_count = custom_var_v5 WHERE custom_var_k5 = '_pk_scount'"); | |||
} | |||
|
|||
$logVisit = Common::prefixTable('log_visit'); | |||
// until 3.14.0 config_cookie was always 0 if cookies were disabled so for most visits this will be fairly accurate. | |||
$migrations[] = $this->migration->db->sql("UPDATE $logVisit SET profilable = config_cookie WHERE profilable is null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It be a problem if someone was using Matomo 3.14.0 for a long time, then upgraded to Matomo 4. Then this may not be as accurate. Could also remove this update script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be fine to leave it, but it would be important to document it in the developer changelor or in the changelog somewhere. btw would it be maybe possible to update only up to the time that they had upgraded to 3.14.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK we don't know when they upgraded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Profilable as a name sounds good to me 👍
How would we document this feature, maybe in a FAQ "What is the Profilable dimension?" to start with something basic? (we could also later link to the faq from other relevant user guides and other relevant faqs)
@@ -153,6 +155,10 @@ public function getMigrations(Updater $updater) | |||
$migrations[] = $this->migration->db->sql("UPDATE $visitActionTable SET search_count = custom_var_v5 WHERE custom_var_k5 = '_pk_scount'"); | |||
} | |||
|
|||
$logVisit = Common::prefixTable('log_visit'); | |||
// until 3.14.0 config_cookie was always 0 if cookies were disabled so for most visits this will be fairly accurate. | |||
$migrations[] = $this->migration->db->sql("UPDATE $logVisit SET profilable = config_cookie WHERE profilable is null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be fine to leave it, but it would be important to document it in the developer changelor or in the changelog somewhere. btw would it be maybe possible to update only up to the time that they had upgraded to 3.14.0?
@mattab we'll document it later once merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests need to be updated/fixed. Otherwise looks good 👍
@@ -160,6 +160,10 @@ | |||
<column_name>location_region</column_name> | |||
<default_value /> | |||
</row> | |||
<row> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess the file permission change wasn't on purpose. But as it's a test file I guess it doesn't hurt...
fix #16192
After lots of thinking came up with the dimension name "profilable" to have it working as well for iOS, Android etc which doesn't rely on cookies etc. I guess that's really the essence of it. Which users can be tracked over several visits vs which can't. Happy to change the name if anything is better.
After some thinking also didn't add a new tracking parameter for now. Generally, it should work out of the box using the visitorId. If cookies are disabled, then no visitorId is sent. Technically we can't rely on cookies alone cause if you are disabling cookies but use userId feature, then the user can be still profiled over several visits. I reckon for now it's not needed to introduce a new tracking parameter. Eventually could have like a parameter
_pr
or so if needed maybe to force a certain value? Not sure if there are cases where it wouldn't be accurate based on visitorId?