nextjs 接入 谷歌分析
创建媒体资源文档
GSC
GA地址
nextjs接入
参考地址
将 Google Analytics 与 Next.js 结合使用(通过 next/script
)
@next/third-parties
event
自定义维度和指标
重点
现有事件
自定义事件
'use client'import { sendGAEvent } from '@next/third-parties/google'export function EventButton() {return (<div><buttononClick={() => sendGAEvent('event', 'buttonClicked', { value: 'xyz' })}>Send Event</button></div>)
}