Next.js Discord

Discord Forum

Third Party Libraries - Google Analytics

Unanswered
Thrianta posted this in #help-forum
Open in Discord
ThriantaOP
Hello, I'm trying to integrate Google Analytics in my Next.js project (v14.1.3).
But the sendGAEvent function is not sending a /collect request at all; instead, it's adding the event to the data layer array.
I followed the documentation, but it was unsuccessful.

This is my function to send a request (just like in the documentation):
onClick={() => sendGAEvent({ event: 'buttonClicked', value: 'xyz' })}

0 Replies