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

[question] Matomo - Full Photo view logging #348

Closed
Fireballcz opened this issue Sep 25, 2019 · 9 comments
Closed

[question] Matomo - Full Photo view logging #348

Fireballcz opened this issue Sep 25, 2019 · 9 comments

Comments

@Fireballcz
Copy link

Hello, please is there a way how to force Matomo log to see, which Full Photo was viewed by a visitor?
Many thanks!

@kamil4
Copy link
Contributor

kamil4 commented Sep 25, 2019

I have no experience with Matomo log. However, have you checked your HTTP daemon access logs? Anything accessed in uploads/big/ will be Full/Original images, or uploads/medium/ for the Lychee photo view (although in that case we are also prefetching the next and previous images so you'll get some false positives as well).

@Fireballcz
Copy link
Author

Fireballcz commented Sep 25, 2019 via email

@kamil4
Copy link
Contributor

kamil4 commented Sep 26, 2019

I see. You are looking for an ability to inject custom code into Lychee-generated pages. I don't believe we have anything of that sort ready to go for HTML/JS (we do have support for custom CSS).

You could add it to the gallery blade (https://github.com/LycheeOrg/Lychee-Laravel/blob/master/resources/views/gallery.blade.php), which is a template for all Lychee gallery pages. That would probably be the simplest. However, the template is used both for the photo view and for the album(s) views, while it sounds like you are only interested in photo view? That will be more tricky I think. If that is what you want, I think you will need to add your code directly to our JavaScript front end. view.photo.init or one of the functions it calls (e.g., view.photo.photo) are probably your best bet. Instructions on how to recompile the front end are here.

@Fireballcz
Copy link
Author

Fireballcz commented Sep 26, 2019 via email

@julianwachholz
Copy link

Hi there! I am also interested in adding a custom HTML tag on all pages such as Google Analytics/Matomo/etc.

As there already is a custom CSS option, this could be done in a similar fashion? I don't think it makes sense to limit it to a single template.

@Fireballcz
Copy link
Author

Hi there! I am also interested in adding a custom HTML tag on all pages such as Google Analytics/Matomo/etc.
As there already is a custom CSS option, this could be done in a similar fashion? I don't think it makes sense to limit it to a single template.

Hello Julian!
I trided to add Matomo analytics script. I was partially successful.
Analytics script can be injected in resources/views/gallery.blade.php inside section

@section('head-js')
@endsection

In this case is page hit counted only once, no matter, which next gallery/images are viewed.

Script can be also injected in resources/views/includes/blade.head.php, just above
<script src="dist/Larapass.js"></script>
Problem is, that currently viewed gallery/image url is not evaluated correctly, so in Matomo you see just a number of hits, not correct gallery/image url hit :(.

If you find out, how to correctly evaluate gallery/image url, please, do not forget share your find.
Thanks!
Fire

@julianwachholz
Copy link

Thanks for the suggestion. It seems trying to integrate Matomo would be more effort than it is worth.

But, since I am only running the plain Docker image I can't easily change files within it, without building my own image first.

@Fireballcz
Copy link
Author

Im using option two. My luck is, that Im running Apache and LL on my own server, so I have full access to the server logs. Matomo shows me the frequency of user hits, so I can filter logs, to see exact gallery/image hits.

@ildyria
Copy link
Member

ildyria commented Jul 11, 2023

Now supported.

@ildyria ildyria closed this as completed Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants