sualko / cloud_piwik

Track @Nextcloud users with @matomo-org (formerly Piwik)
http://sualko.github.io/cloud_piwik/
MIT License
37 stars 18 forks source link

No file tracking log after upgrading from v 0.3.2 to v 0.4.0 #59

Closed danielepercivaldi closed 6 years ago

danielepercivaldi commented 6 years ago

Expected behavior

Browsing Nextcloud all actions are logged by matomo

Actual behavior

Browsing Nextcloud no action about file tracking is logged by matomo (only dir, app, users and settings).

Steps to reproduce the behavior

Upgrade from cloud_piwik 0.3.2 to 0.4.0

Environment

Logs

Javascript

No error in console #### Nextcloud

No error log in Nextcloud

Workaround

Backed to version 0.3.2

sualko commented 6 years ago

Have you tried turn it off and on again? :smile: Same users reported before that disabling and enabling the app solves your issue.

gema2007 commented 6 years ago

I have the same problem. No logs arrive at Matomo Ubuntu 16.04 Nextcloud 13.0.2

davidv92 commented 6 years ago

I have the same problem. What is the simplest way to come back to version 0.3.2 ?

gema2007 commented 6 years ago

deactivate App go to your-site/apps delete folder piwik download version 0.3.2 unzip it in folder apps adjust permissions activate app

sualko commented 6 years ago

I'm sorry guys, but without logs I can't help. Did you try to increase the log level?

danielepercivaldi commented 6 years ago

Hi @sualko. I've just:

  1. set debug log level
  2. deleted log file
  3. restarted apache
  4. browsed some folders
  5. open one image
  6. downloaded the log file

Hope it can help you. Thanks.

nextcloud.log

fa-ribeiro commented 6 years ago

Ok,, I had the same problem and I think I found the issue:

The correct form is //analytics.example.com/; if you enter //analytics.example.com (no trailing slash), it will not work.

PS: @sualko, maybe programatically check for the existence of the trailing slash and add it if not present?

danielepercivaldi commented 6 years ago

Hi @fa-ribeiro . My configuration already includes the trailing slash in the end (//xxx.xxxxxxxx.xx/matomo/). It does not work.

Thanks.

sualko commented 6 years ago

Can you check if /apps/piwik/js/track.js is loaded/included? Just open the the source code of any Nextcloud page (mostly ctrl+u). Can you also check if you have any errors in your js console (ctrl+shift+i)?

danielepercivaldi commented 6 years ago

Hi @sualko . Yes, /apps/piwik/js/track.js exists. Yes, track.js is loaded. No, no log about track.js.

sualko commented 6 years ago

@danielepercivaldi can you send the url to your Nextcloud instance to klaus@jsxc.org?

sualko commented 6 years ago

Ok, now I understand the issue better. I thought there is no action tracked at all, but it's "only" about file browsing actions which are not tracked. Not sure when I have time to look into this in more detail.

sualko commented 6 years ago

I guess the fix is easier than thought. Can someone try to change https://github.com/sualko/cloud_piwik/blob/master/js/track.js#L76 to if (options.trackDir === true) {?

danielepercivaldi commented 6 years ago

Done. Uhm for me it's line 90. It does not work yet. I also discovered that I'm not able to CHANGE the configuration option "Track file browsing". It is checked and if I uncheck it the new value is not set and backs to checked state. Are you sure you load app configuration?

sualko commented 6 years ago

Can you test the latest release?

danielepercivaldi commented 6 years ago

Hi @sualko . Well:

  1. "track file browsing" checkbox is ok
  2. tracking tracks folder browsing, NOT file, i.e. if I open an image it is not tracked. Is it right?
sualko commented 6 years ago

tracking tracks folder browsing, NOT file, i.e. if I open an image it is not tracked. Is it right?

That's the intended behavior. Thanks for testing.