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

add matomo script and connect it with base template #320

Merged
merged 7 commits into from
Dec 19, 2023

Conversation

Akiyamka
Copy link
Contributor

No description provided.

@Xpirix
Copy link
Collaborator

Xpirix commented Nov 30, 2023

Thank you for this work. I tested it locally but I assume that we need to connect to matomo.qgis.org to see if it works.

Besides, I have a few suggestions about the integration of matomo in QGIS-Django:

  • I agree with @timlinux comments at add matomo metrics in base template kartoza/prj.app#1452 to softcode the URL but also the SITE_ID into the site configuration.
  • How about using django-matomo since this website is based on Django? I noticed that this package is listed as an official Django integration and it's easier to manage the variables MATOMO_SITE_ID and MATOMO_URL through the settings.py and the environments variables.

We could also ask @dimasciput about how the environment variables are implemented in production.

@Akiyamka
Copy link
Contributor Author

@Xpirix, thanks for the tip to use the plugin, seems like a good idea, I'll try to use it

@Akiyamka
Copy link
Contributor Author

Akiyamka commented Dec 8, 2023

@Xpirix, I installed motomo-plugin according to its documentation, although I had no luck getting the project to work after installing it. Maybe I'm doing something wrong. Could you please take a look? Below is the error I'm getting

Log
TemplateSyntaxError  at'matomo_tags' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_static
admin_urls
avatar_exists
bootstrap_pagination
cache
flatpages
highlight
humanize
i18n
l10n
local_timezone
log
more_like_this
plugin_utils
plugins_tagcloud
range_filter
rating_filters
ratings
resources_custom_tags
rest_framework
rpctags
simplemenu_tags
smart_paginate
sorl_thumbnail
sort_anchor
static
staticfiles
styles_custom_tags
taggit_extras
thumbnail
tz</pre>
  
Request Method: | GET
-- | --
http://0.0.0.0:62202/

2.2.25
TemplateSyntaxError
'matomo_tags' is not a registered tag library.
/usr/local/lib/python3.7/site-packages/django/template/defaulttags.py in find_library, line 1025
/usr/local/bin/python
3.7.2
['/home/web/django_project',  '/home/web/django_project',  '/usr/local/lib/python37.zip',  '/usr/local/lib/python3.7',  '/usr/local/lib/python3.7/lib-dynload',  '/usr/local/lib/python3.7/site-packages']
Fri, 8 Dec 2023 11:17:38 -0600

[Full log](https://gist.github.com/Akiyamka/fd2baa51b2837144b59bc8affcc95aed)

I have a suspicion that django 2 is too old for this plugin.

@Xpirix
Copy link
Collaborator

Xpirix commented Dec 11, 2023

Hello @Akiyamka , I've checked it locally and had the same error too. Adding matomo to the INSTALLED_APPS in settings_docker.py fixed the error. This is because django is using this file for docker environment. But I think other settings files need also to be updated to avoid the error in different environments.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6589e3c) 81.94% compared to head (729af55) 81.96%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
+ Coverage   81.94%   81.96%   +0.01%     
==========================================
  Files         139      139              
  Lines        5418     5422       +4     
==========================================
+ Hits         4440     4444       +4     
  Misses        978      978              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Xpirix Xpirix requested a review from dimasciput December 15, 2023 16:36
@Xpirix
Copy link
Collaborator

Xpirix commented Dec 15, 2023

Looks good to me. Thank you @Akiyamka.

@timlinux
Copy link
Member

@dimasciput can you review, merge deploy please?

@dimasciput dimasciput merged commit d27e30b into qgis:master Dec 19, 2023
2 checks passed
@dimasciput
Copy link
Collaborator

@timlinux @Xpirix before deploying this we probably might need to update the privacy policy.

@timlinux
Copy link
Member

@dimasciput can you link to the policy in question?

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

Successfully merging this pull request may close these issues.

5 participants