Skip to content
Snippets Groups Projects

Matomo web component

Merged Neuber, Eugen Ramon requested to merge matomo-component into master
3 unresolved threads

Move Matomo related initialization to its own web component. Use this web component in App-shell.

App-shell has two new parameters: matomo-url and matomo-site-id. These are required for tracking, but tracking is still optional.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 [submodule "vendor/auth"]
  • 41 }
    42
    43 setupMatomo(loggedIn) {
    44 if (loggedIn && ! this.isRunning) {
    45 if (this.siteId === -1) {
    46 console.log('site id missing, skipping matomo...');
    47 return;
    48 }
    49 if (this.endpoint === '') {
    50 console.log('endpoint missing, skipping matomo...');
    51 return;
    52 }
    53 console.log('add matomo...');
    54
    55 window._paq = window._paq || [];
    56 _paq.push(['setCustomVariable', 1, "GitCommit", "<%= buildInfo.info %>", "visit"]);
  • 100 return;
    101 }
    102 if (! loggedIn && this.isRunning) {
    103 // TODO: reomve those event listeners
    104 console.log('remove matomo...');
    105 this.isRunning = false;
    106 }
    107 }
    108
    109 track (action, message) {
    110 console.log('MatomoElement (' + this.isRunning + '): ' + action + ', ' + message);
    111 const event = ['trackEvent', action, message];
    112 if (this.isRunning) {
    113 _paq.push(event);
    114 } else {
    115 this.lastEvent = event;
  • added 1 commit

    Compare with previous version

  • mentioned in commit bac4b031

  • added 1 commit

    • bac4b031 - Read git commit from `buildInfo`

    Compare with previous version

  • I will accept the merge request so @19320D286FE1E97C can work on the integration.

  • mentioned in commit 9dc05ecd

  • Please register or sign in to reply
    Loading