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
New Goal type: Convert when user stays more than X minutes on the site #14508
Conversation
Is there an issue for this? |
Not that I could find, though matt thought there was one, I noticed the discrepancy when working on the GA importer. There are goal types we won't be able to import. It didn't seem like a complicated change. GA provides 'visit duration' goals + 'total number of pages viewed'. They also allow matching on multiple event attributes, but that seems like a more complicated addition. |
plugins/Goals/API.php
Outdated
{ | ||
if (empty($patternType)) { | ||
return ''; | ||
} | ||
|
||
$patternType = strtolower($patternType); | ||
|
||
$validator = new WhitelistedValue(['exact', 'contains', 'regex']); | ||
if (in_array($matchAttribute, GoalManager::$NUMERIC_MATCH_ATTRIBUTES)) { | ||
$validValues = ['>']; |
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.
not sure, should we maybe use greater_than
or so?
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.
I think we do this in some other places.
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.
There's a limit on the field size, I think 'greater_than' was a little too long. Didn't want to create a db upgrade for something so small, but I can if it's better.
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's fine to have an update for it as it's not a log table.
Seems to work otherwise in general 👍 . Only now seeing we enter the visit duration in minutes, should it be seconds maybe? just to be a bit more flexible... although I don't think anyone would want to trigger a goal after a few seconds... so minutes should be fine. |
Minutes should be better I reckon, but maybe allow for less than 1 minutes, or in general decimal minutes (1.5, 5.5, etc) so it's flexible (didn't check if maybe this already works) |
Feedback:
Looking forward to merging this so we can start beta testing our Google Analytics importer 🚀 🚀 |
@mattab updated everything except screenshot test update |
Looks great & works! 👍 @diosmosis Be great if you could also edit the user guide at https://matomo.org/docs/tracking-goals-web-analytics/ and mention this new goal type and feature. (just added it now to: https://matomo.org/features) |
Updated. |
This PR adds the following types of goals: