#Google Analytics via @next/third-parties Real Time Issue
1 messages · Page 1 of 1 (latest)
Hi @noble ether. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources provided, there appears to be an issue with Google Analytics via @next/third-parties not working correctly for real-time analytics. This problem has been reported and discussed in a GitHub issue for the Next.js repository.
According to the GitHub issue discussion, several users have reported that custom events and real-time analytics are not working as expected when using the @next/third-parties package for Google Analytics integration.
The main points from the discussion are:
- Custom events don't register when using the
sendGAEvent()function. - The
/collectrequest is not being sent to Google Analytics in some cases. - Default events (like scroll and view) seem to work fine, but custom ones are not.
A potential fix for this issue was merged, but it appears that the problem may still persist for some users. The latest update suggests using the following syntax for sending events:
sendGAEvent('event', 'buttonClicked', { value: 'xyz' })
Instead of:
sendGAEvent({ event: 'buttonClicked', value: 'xyz' })
It's worth noting that this issue is still being investigated and discussed, and there might not be a definitive solution yet.
To troubleshoot this issue, you could try:
- Updating to the latest version of
@next/third-parties. - Ensuring you're using the correct syntax for sending events as mentioned above.
- Verifying that the Google Analytics component is properly implemented in your Next.js application.
If the problem persists, you might want to consider using an alternative method for implementing Google Analytics or waiting for further updates from the Next.js team.