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

Set up Matomo for analytics/tracking #44

Merged
merged 3 commits into from
Aug 23, 2023
Merged

Conversation

herrherrmann
Copy link
Collaborator

@herrherrmann herrherrmann commented Aug 21, 2023

Sets up the Matomo integration via matomo-next and also addresses the "multi-init" issue mentioned here. This tracks every page visit and all 5 buttons on our homepage (4× "Contact us" + 1× "Create random request").

The dashboard can be found here: https://piwik.technologiestiftung-berlin.de/index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=37#?period=day&date=yesterday&category=Dashboard_Dashboard&subcategory=1

⚠️ Breaking changes

We now have two new environment variables in .env (they can be left empty to not do any tracking):

NEXT_PUBLIC_MATOMO_URL=https://piwik.technologiestiftung-berlin.de
NEXT_PUBLIC_MATOMO_SITE_ID=1234

--> You can get the actual NEXT_PUBLIC_MATOMO_SITE_ID from our Matomo dashboard.

🔍 Testing hints

You need to turn off "Do not track" and disable any ad blockers to test this. Your events should show up in the dashboard under Visitors → Real-time. Or in the visits log:

Bildschirmfoto 2023-08-21 um 16 56 44


@herrherrmann herrherrmann self-assigned this Aug 21, 2023
@render
Copy link

render bot commented Aug 21, 2023

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@socialgouv/matomo-next 1.6.1 None +0 39.1 kB socialgroovybot

@herrherrmann herrherrmann marked this pull request as ready for review August 21, 2023 14:54
@ZenVega
Copy link
Contributor

ZenVega commented Aug 23, 2023

I got trouble reconstructing this. I don't have the credentials for the login and when I was running it locally and @BugBoomBang logged in to matomo there was no effect visible. however I don't know, if I fulfilled all the privacy settings you mentioned or had an error with the .env variables. Codevise it makes sense to me. maybe you @herrherrmann could give me or @BugBoomBang a walkthrough of some kind?

@herrherrmann herrherrmann merged commit 90cb697 into main Aug 23, 2023
@herrherrmann herrherrmann deleted the add-matomo-tracking branch August 23, 2023 15:02
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