feat(matomo): Added button tracking

This commit is contained in:
Timothy Stewart
2022-03-19 14:26:45 -05:00
parent 6f366acf9e
commit da9c34f4ac
2 changed files with 7 additions and 0 deletions

3
src/analytics/matomo.js Normal file
View File

@@ -0,0 +1,3 @@
export function trackMatomoEvent(event) {
window._paq.push(['trackEvent', event]);
}

View File

@@ -4,6 +4,7 @@ import { trackGoogleEvent } from '../../analytics/google';
import { runtimeConfig } from '../../config';
import { trackUmamiEvent } from '../../analytics/umami';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { trackMatomoEvent } from '../../analytics/matomo';
function Button(props) {
const { name, href, displayName, logo, styles, alt, icon } = props;
@@ -17,6 +18,9 @@ function Button(props) {
if (runtimeConfig?.UMAMI_WEBSITE_ID && runtimeConfig?.UMAMI_APP_URL) {
trackUmamiEvent(eventName);
}
if (runtimeConfig?.MATOMO_SITE_ID && runtimeConfig?.MATOMO_URL) {
trackMatomoEvent(eventName);
}
};
return (