matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.91k stars 2.65k forks source link

Transitions: reports about previous and following actions for each page URL #3332

Closed timo-bes closed 10 years ago

timo-bes commented 12 years ago

Awesome feature: Analytics Previous / next pages

For each page URL, this plugin reports the top X

The information is given in a popover which can be launched via a table action on the pages report.

mattab commented 12 years ago

(In [7052]) Refs #3332 will test latest Transitions update on demo :)

mattab commented 12 years ago

(In [7054]) Refs #3332 Fixing error when merged JS file, broadcast.js should be loaded before other files eg. it is used in datatable_rowactions.js which was loaded first on the demo

mattab commented 12 years ago

very nice changes!

I put some screenshots to show examples of the latest of Transitions.

Feedback:

Having internal searches in the center is interesting but that kind of info should be included in the internal search plugin.

It isn't planned in SiteSearch to show the most "pages starting a search" or "Most visited pages after search". I think in fact it should use transitions for that, since it's the perfect UI for it.

It would be nice to have downloads, campaigns and external websites in the center.

It would be really great to have... Hopefully you might change your mind before V1 :)

mattab commented 12 years ago

Further feedback:

#module=Actions&action=indexPageUrls&idSite=7&period=month&date=2012-08-23&RowAction=Transitions:http://forum.piwik.org/

instead of

#module=Actions&action=indexPageUrls&idSite=7&period=month&date=2012-08-23#RowAction:Transitions:http://forum.piwik.org/
==================

Timo's answer:

  • Now that I think of it, it's interesting that it works with the double hash tag in the URLs... I even tested with IE and it works. I'm not sure if it's standard practise, did you try to have a Hash tag as follows?

We need to have two separate parts because the change of the second part should not cause a change to be triggered in the first part. This means that when the popover changes the report in the background should not be reloaded. Apart from perfomance that would be really bad if a user has opened several folders on the actions report and the actions report is back to start when he closes the popover.

timo-bes commented 12 years ago

(In [7057]) refs #3332 Transitions:

timo-bes commented 12 years ago

I'm sorry, I changed you last comment (#3332) instead of replying to it. I still have it in my notes so none of your suggestions will be lost :)

timo-bes commented 12 years ago

On this screenshot you can see that the sum of incoming traffic+reload is not equal to the pageviews of the clicked page. 49192+5716+366+116161155 = -4720 pages difference. What do you think are possible explanations for such discrepency ?

There can be multiple reasons:

timo-bes commented 12 years ago

(In [7058]) refs #3332 Transitions:

timo-bes commented 12 years ago

(In [7059]) refs #3332 Transitions:

timo-bes commented 12 years ago

Please update the demo so that we can verify that the problems you reported are fixed.

timo-bes commented 12 years ago

I had a crazy idea... If we really trust the queries i wrote, we can derive the number of exits from pageviews - following pages - outlinks - downloads. If we abandon the number of bounces, we could get rid of using the actions report altogether! That should speed everything up a lot - especially for pages with many distinct URLs. Thoughts?

mattab commented 12 years ago

Replying to EZdesign:

I had a crazy idea... If we really trust the queries i wrote, we can derive the number of exits from pageviews - following pages - outlinks - downloads. If we abandon the number of bounces, we could get rid of using the actions report altogether! That should speed everything up a lot - especially for pages with many distinct URLs. Thoughts?

Getting rid of bounces is not a problem, so if it makes code faster, sounds really good to me!

mattab commented 12 years ago

(In [7066]) Refs #3332 Will test new Transitions on demo (Nice tooltip!!) ;-)

timo-bes commented 12 years ago

(In [7072]) refs #3332 Transitions: the actions blob report is not used anymore - improved performance, consistency problems are gone, bounces are not available anymore

timo-bes commented 12 years ago

(In [7073]) refs #3332 Transitions performance tuning

timo-bes commented 12 years ago

After the last refactoring, the MySQL queries account for almost the entire processing time when switching between pages. Speeding them up will improve the UX a lot.

Here are the indexes that will do the job:

ALTER TABLE  `piwik_log_link_visit_action` ADD INDEX  `transitions_url` (  `idaction_url` ,  `idsite` ,  `server_time` );

ALTER TABLE  `piwik_log_link_visit_action` ADD INDEX  `transitions_url_ref` (  `idaction_url_ref` ,  `idsite` ,  `server_time` );

ALTER TABLE  `piwik_log_visit` ADD INDEX  `transitions` (  `visit_entry_idaction_url` ,  `idsite` ,  `visit_last_action_time` );

The order of the columns is very important. Make sure not to change it.

I'm not saying we should add them by default but maybe we can document that adding them will speep up transitions tremendously. On my Piwik, it brought processing time down from 1-2s to 100-200ms. For larger databases, the factor should be even bigger. Maybe we can try on the demo?

timo-bes commented 12 years ago

(In [7074]) refs #3332 Transitions:

mattab commented 12 years ago

Excellent updates, faster & simpler code...

My last request as you know would be to support Transitions for Page Titles... then the feature will be fully complete IMHO!

mattab commented 12 years ago

It seems the "Direct entry" metric is not processed correctly, see two attached example screens of missing direct entry.

timo-bes commented 12 years ago

(In [7091]) refs #3332 Transitions

timo-bes commented 12 years ago

(In [7093]) refs #3332 Transitions:

mattab commented 12 years ago

Kuddos Timo for all these great commits....!

I will update on demo now to test further!

mattab commented 12 years ago

(In [7103]) Refs #3332 Summing rows now keep the latest metadata to ensure the latest format of URLs is used when summing over large date range

mattab commented 12 years ago

After using Transitions further, I have the following suggestion

mattab commented 12 years ago

(In [7113]) Refs #3332

mattab commented 12 years ago

(In [7114]) Refs #3332 Will test latest changes on demo, to check if no more bugs

mattab commented 12 years ago
timo-bes commented 12 years ago

(In [7124]) refs #3332

timo-bes commented 12 years ago

Replying to matt:

  • Suggestion: Display the Transitions icon on directories

If you want to see tranitions for example.org/foo/bar/, just open it on foo > bar > index. Doing it for foo/bar/* (i.e. the sum of everything in the directory) doesn't work by design because Transitions always shows stats for one idaction only. Doing something else would mean major code changes and performance issues. I'm generally not in favor for doing that but one week before the release that's definitely not possible...

timo-bes commented 12 years ago

(In [7125]) refs #3332

timo-bes commented 12 years ago

(In [7126]) refs #3332

timo-bes commented 12 years ago

It seems "Page title not defined" page title does not show Transitions but appears in Previous/Next. Does it sometime work? to be tested further

It works for me. Maybe I fixed it in [7126]? Please try again.

timo-bes commented 12 years ago

(In [7128]) refs #3332: edges on the sides are a bit straighter

timo-bes commented 12 years ago

(In [7132]) refs #3332

timo-bes commented 12 years ago

(In [7133]) refs #3332: more cross browser compatibility and other fixes

Apart from translation and documentation, that's it!

PLEASE TEST AS MUCH AS YOU CAN AFTER THIS COMMIT!

timo-bes commented 12 years ago

(In [7137]) refs #3332

mattab commented 12 years ago

(In [7143]) Refs #3332 Fixing JS error on admin pages

FYI since Piwik_Controller is only used for reports controllers (where as Piwik_Controller_Admin is for admin controllers), the separator wasn't set on admin screens

mattab commented 12 years ago

(In [7148]) Refs #3332 This will set the metadata on the URL with the most page views, for daily reports Note to self: we could add a test case for this...

mattab commented 12 years ago

(In [7160]) Refs #3332 Hopefully, fixing all problems with URL being incorrectly aggregated! Thanks Timo for the hint and bug in previous algorithm

mattab commented 12 years ago

Test message notification?

mattab commented 12 years ago

It seems that all "data bugs" should now be fixed, please notify me if you find any further issue!

Timo, I noticed there is a small problem: unicode characters don't get displayed, instead the URL encoded version is displayed, in Transitions.

For example in this URL

See attached screenshot

timo-bes commented 12 years ago

Replying to matt:

Timo, I noticed there is a small problem: unicode characters don't get displayed, instead the URL encoded version is displayed, in Transitions.

The UTF8 chars are shown in the label of the report but the link is urlencoded. That's why it's urlencoded in transitions. I'm pretty sure the urlencoded version is also what's in the database because Transitions looks for this version and works.

So what's the best behavior? Should we urldecode once before displaying urls in Transitions? What does the actions report do with the label?

timo-bes commented 12 years ago

(In [7165]) refs #3332 Transitions help button linking to doc page

timo-bes commented 12 years ago

(In [7166]) refs #3332: url decode in transitions in order to display utf8 urls

timo-bes commented 12 years ago

Please test the latest commit on the demo. The UTF8 chars should work now.

I tested the code with a url that contains both utf8 chars and an html tag. UTF8 encoding and XSS protection ist working in the center box, side boxes and the tooltip. Nevertheless, please test and review closely.

timo-bes commented 12 years ago

OK guys, this is it.

If you can't find more problems, we can close the ticket! Yay!!!

timo-bes commented 12 years ago

(In [7189]) fixes #3332

timo-bes commented 12 years ago

(In [7201]) refs #2992, refs #3332: integrating previous and following internal searches into transitions. the code is starting to get a little complicated ;-)

timo-bes commented 12 years ago

(In [7214]) refs #2992, refs #3332 fixing two ui bugs in transitions / site search integration

timo-bes commented 12 years ago

(In [7216]) refs #3332, refs #2992 making transitions center box higher because new lines were added for site search. fixing a js bug when truncating urls.