This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from axone-protocol/feat/matomo
Add matomo analytics
- Loading branch information
Showing
4 changed files
with
429 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use client'; | ||
|
||
import { init } from '@socialgouv/matomo-next'; | ||
import { useEffect } from 'react'; | ||
|
||
const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL as string; | ||
const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID as string; | ||
|
||
const MatomoInitializer = () => { | ||
useEffect(() => { | ||
if (!MATOMO_URL || !MATOMO_SITE_ID) { | ||
return; | ||
} | ||
init({ url: MATOMO_URL, siteId: MATOMO_SITE_ID }); | ||
}, []); | ||
|
||
return null; | ||
}; | ||
|
||
export default MatomoInitializer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.