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

fix Umami Analytics #34

Merged
merged 12 commits into from
Sep 9, 2024
Merged

fix Umami Analytics #34

merged 12 commits into from
Sep 9, 2024

Conversation

chraebsli
Copy link
Owner

@chraebsli chraebsli commented Sep 9, 2024

Summary by Sourcery

Fix the Umami Analytics integration by updating the script URL and configuration, and enhance user interaction tracking across multiple components using a new umamiTrack utility function.

Bug Fixes:

  • Fix Umami Analytics script URL and configuration in the HTML file to ensure proper tracking.

Enhancements:

  • Add Umami tracking to various components including SocialItem, Header, LanguageSwitcher, and the main App component to track user interactions.

Chores:

  • Remove the Digistats script and its associated Content-Security-Policy from the project configuration.

Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
portfolio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 11:38am

Copy link

sourcery-ai bot commented Sep 9, 2024

Reviewer's Guide by Sourcery

This pull request updates the analytics implementation by replacing Digistats with Umami Analytics. It also adds event tracking for various user interactions throughout the application.

File-Level Changes

Change Details Files
Replace Digistats with Umami Analytics
  • Remove Digistats script
  • Update Umami Analytics script with new URL and data-domains attribute
  • Remove Content-Security-Policy header from vercel.json
public/index.html
vercel.json
Implement Umami event tracking
  • Create umamiTrack utility function
  • Add event tracking for social item clicks
  • Add event tracking for navigation clicks
  • Add event tracking for language switches
  • Add event tracking for theme switches
src/tools/umamiTrack.ts
src/components/social/SocialItem.tsx
src/components/common/Header.tsx
src/components/common/LanguageSwitcher.tsx
src/index.tsx

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @chraebsli - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The removal of the Content Security Policy in vercel.json could pose security risks. Consider updating the CSP to accommodate the new analytics implementation instead of removing it entirely.
  • In the umamiTrack function, consider defining a more specific type for the options parameter instead of using 'any' for better type safety.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

vercel.json Show resolved Hide resolved
src/components/social/SocialItem.tsx Outdated Show resolved Hide resolved
src/components/common/LanguageSwitcher.tsx Outdated Show resolved Hide resolved
@chraebsli chraebsli merged commit a46dda0 into main Sep 9, 2024
7 checks passed
@chraebsli chraebsli deleted the analytics branch September 9, 2024 11:39
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.

1 participant