mirror of
https://github.com/techno-tim/littlelink-server.git
synced 2025-03-04 16:08:28 -06:00
feat(matomo): Added button tracking
This commit is contained in:
3
src/analytics/matomo.js
Normal file
3
src/analytics/matomo.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export function trackMatomoEvent(event) {
|
||||
window._paq.push(['trackEvent', event]);
|
||||
}
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user