Conversion Tracking
45-90 minAdvanced
Track key conversion events (e.g., form submissions, purchases) and send them to your analytics/ads platforms.
Prerequisites
- Event names defined
Intermediate Recommended
Custom Events
Using analytics libraries.
1
Triggering Events
1
Call your analytics provider's event function upon successful completion of a goal.
2
Example with GA4 via @next/third-parties.
Example
import { sendGAEvent } from '@next/third-parties/google'
const handleSubmit = async () => {
// ... submit logic ...
sendGAEvent({ event: 'generate_lead', value: 'newsletter' })
}Verification Checklist
- Perform the conversion action and verify the event fires in debug mode.