Navigation Menu

Skip to content
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

Merged
merged 6 commits into from Jul 27, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 17, 2020

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?

@tsteur tsteur added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Jul 17, 2020
@tsteur tsteur added this to the 4.0.0 milestone Jul 17, 2020
@tsteur tsteur added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Jul 17, 2020
@@ -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");
Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

@mattab mattab left a 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");
Copy link
Member

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?

@tsteur
Copy link
Member Author

tsteur commented Jul 20, 2020

@mattab we'll document it later once merged.

Copy link
Member

@sgiehl sgiehl left a 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>
Copy link
Member

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...

@tsteur tsteur merged commit 8f035ba into 4.x-dev Jul 27, 2020
@tsteur tsteur deleted the m16192 branch July 27, 2020 01:27
@mattab mattab changed the title Add new dimension profilable Add new dimension Profilable and new column log_visit.profilable Sep 28, 2020
@mattab mattab changed the title Add new dimension Profilable and new column log_visit.profilable Add new dimension and segment "Profilable" (and new column log_visit.profilable) Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new dimension and segment whether cookies were used or not: "Profilable"
3 participants