Tracking Events
Chapter 4:
Step 5 - Send Custom Events
You can use the Link component to send custom events to Google Analytics when users interact with links.
When the link is clicked, it sends a custom event (gtag('event', ...)) to Google Analytics.
You can customize the event details, such as category, action, and label.
Additional Utility Functions:
sendAnalyticsEvent: Manually sends a custom event.
pageview: Tracks page views.
acceptCookies: Updates consent to enable analytics.
Last updated