thehyve / ot-ui-apps

Apache License 2.0
1 stars 0 forks source link

Add matomo tracking to genetics app #4

Closed alepev closed 1 year ago

alepev commented 1 year ago

Relates to https://github.com/thehyve/opentargets-genetics-automation/pull/34

Original issue description

alepev commented 1 year ago

@RobinM-code (and others) see changes in last commit + related commit in otg-automation. this doesn't seem to work, i.e. I can install Matomo but it doesn't seem to track user activity. I tried several variations without success.

alepev commented 1 year ago

I just pushed some changes (thanks @fedde-s) to use string replacement to replace the Matomo placeholder value with the URL provided by the user, only if Matomo is enabled; the string replacement takes place in the docker-compose, so it won't be possible to test Matomo with yarn unless one adds the desired Matomo URL to init_matomo.js manually. See also last commits to otg-automation PR

fedde-s commented 1 year ago

see changes in last commit […] this doesn't seem to work

We've since solved it in a different way, but for context on why I expect it didn't work:
import statements in the files in src/ are parsed during transpilation/bundling. matomo_init.js Is in public/ and kept as an unprocessed, statically served file. By the time the browser runs it, the src/ folder does not exist, as the contents of src/ are minified into the bundles.

alepev commented 1 year ago

Ready for final review