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
Implements "Social network" as a new referrer type #12993
Conversation
FYI: We'll need to check and adjust some plugins as well (not part of this PR) like Users Flow, Attribution, Funnels, ... I presume people will see afterwards a drop in websites referrer types? I wonder if we need to mention in a blog post and explain they are now attributed differently? |
I'm wondering if it maybe would make sense to automatically add an annotation to referrer type report on the day of update to point that out? |
Could do it maybe for a week after the update or so? |
21696ee
to
69aeb7b
Compare
75cca51
to
aa3c60a
Compare
I've updated the code according to the review comments.
That's not easily doable without reprocessing the reports, as the old reports for referrer type did not include that metric. Instead the social networks were included in the websites metric. |
I thought you could do the same thing for when there is no social data in |
Sorry for the delay. The referrer type numbers shown in that table are stored in an extra report. Splitting up the number for websites and socials for older data is not easy. We would need to query the reports for websites and split it up to websites and socials and then calculate all the numbers based on those resulting reports. I think that might be getting very slow when e.g. viewing row evolution. Also those referrer type reports are calculated as goal reports. I guess recalculating those would only be possible by reprocessing the logs. |
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.
|
||
private function completeSocialTablesWithOldReports($dataTable, $idSite, $period, $date, $segment, $expanded, $flat) | ||
{ | ||
return $this->combineDataTables($dataTable, function() use ($idSite, $period, $date, $segment, $expanded, $flat) { |
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.
Maybe we could just add a simple comment to state that we may want to remove this in a year or more likely two years as it then not really won't be needed anymore? With a link to this issue...
/** | ||
* @param DataTable $dataTable | ||
*/ | ||
protected function filterWebsitesForSocials($dataTable, $idSite, $period, $date, $segment, $expanded, $flat) |
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.
can we make those methods private or are there tests for it?
*/ | ||
protected function filterWebsitesForSocials($dataTable, $idSite, $period, $date, $segment, $expanded, $flat) | ||
{ | ||
$dataTable->filter('ColumnCallbackDeleteRow', array('label', function ($url) { |
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.
Might be good to check performance at some stage with a profiler on real data ideally just to see... especially re the groupby and mergeSubtables but also everything else like those filters.
$isMap = true; | ||
$dataTables = $dataTable->getDataTables(); | ||
} else { | ||
$dataTables = [$dataTable]; |
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 wonder if the code could be simplified there eg just if (!$dataTable->getRowCount()) return $callbackForAdditionalData();
? Bit hard to understand currently with if's in top and bottom
Left a few minor comments... we will then definitely need to check which plugins need updating. I think eg funnels, multi attribution ... |
@tsteur I've improved the code according to your suggestions. I've not yet done a profiling and don't know when I will find some time to do that properly. |
Should be all fine then @sgiehl if they were all there before. If there are new ones, be good to have a look just to be sure. |
* Implements new referrer type for social networks * removes footer message from social report * Show social network referrers in Transitions * update / improve tests * Improves API code * use transient cache instead of static properties * remove debugging statement * updates changelog * cs * Update expected test files. * Update expected screenshots
fixes #11102