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 frontend piwik tracking code #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

achen2401
Copy link
Collaborator

@achen2401 achen2401 commented Dec 31, 2024

Add PIWIK Tracking

  • UserId for PIWIK tracking is retrieved via user JWT IDToken, see screenshot (note the key name), for reference, see here via call to AuthConfig API
Screenshot 2024-12-31 at 10 46 55 AM
  • Site ID for PIWIK tracking is retrieved via environment variable set in either appsettings.json (under key client) or env.json. (TBD) The code will look in either one of these regardless. Any one of those variables will work:

    • REACT_APP_MATOMO_SITE_ID
    • MATOMO_SITE_ID
    • REACT_APP_PIWIK_SITE_ID
    • PIWIK_SITE_ID
    • SITE_ID
  • The PIWIK tracking code will not run if either userId or siteId` is null/undefined

Note If adding piwik site Id under the key client in appsettings.json changing code is required see here for the new key-value pair to be returned.
Note If using env.json, new script (like this) is required to populate it with environment variables needed by the frontend

@achen2401 achen2401 marked this pull request as ready for review December 31, 2024 19:08
@achen2401 achen2401 requested review from ivan-c and rpkyle December 31, 2024 19:11
@rpkyle
Copy link

rpkyle commented Dec 31, 2024

I'd cast my vote for using env.json, if it helps avoid further edits to Leaf code. I also favor the position of not inserting elements unrelated to Leaf into appsettings.json, if we can avoid it.

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.

2 participants