Auto-sync: 2026-04-20 07:08
This commit is contained in:
57
wiki/concepts/GA4-Implementation.md
Normal file
57
wiki/concepts/GA4-Implementation.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "GA4 Implementation"
|
||||
type: concept
|
||||
tags: [Analytics, Google, Tracking, Measurement]
|
||||
---
|
||||
|
||||
## Definition
|
||||
GA4(Google Analytics 4)是 Google 的新一代分析平台,基于事件驱动模型提供跨平台、跨设备的学生追踪能力,相比 UA 新增了用户级分析、机器学习预测和隐私优先设计。
|
||||
|
||||
## Core Features
|
||||
- **Event-Based Model**:所有交互转换为事件(自动收集事件 + 自定义事件)
|
||||
- **Enhanced Measurement**:增强型测量,自动追踪滚动、站点搜索、外链点击、视频互动
|
||||
- **Custom Dimensions & Metrics**:自定义维度和指标
|
||||
- **Cross-Domain Tracking**:跨域追踪
|
||||
- **Ecommerce DataLayer**:电商数据层实现(view_item、add_to_cart、begin_checkout、purchase)
|
||||
|
||||
## Key Events
|
||||
| Event | Description |
|
||||
|-------|-------------|
|
||||
| page_view | 页面浏览 |
|
||||
| view_item | 查看产品 |
|
||||
| add_to_cart | 添加到购物车 |
|
||||
| begin_checkout | 开始结账 |
|
||||
| purchase | 完成购买 |
|
||||
| sign_up | 注册 |
|
||||
| generate_lead | 生成 Lead |
|
||||
|
||||
## Data Layer Implementation
|
||||
```javascript
|
||||
dataLayer.push({
|
||||
event: 'purchase',
|
||||
ecommerce: {
|
||||
transaction_id: 'T12345',
|
||||
value: 99.00,
|
||||
currency: 'USD',
|
||||
items: [{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.00,
|
||||
quantity: 1
|
||||
}]
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Debug & Verification
|
||||
- **GA4 DebugView**:实时查看事件发送
|
||||
- **GTM Preview**:GTM 预览模式验证触发
|
||||
- **Network Inspection**:检查 gtag.js 请求参数
|
||||
|
||||
## Related Concepts
|
||||
- [[Conversion Tracking]]:转化追踪
|
||||
- [[Server-Side Tagging]]:服务端标记
|
||||
- [[Consent Mode]]:同意模式
|
||||
|
||||
## Related Entities
|
||||
- [[Paid Media Tracking & Measurement Specialist]]:GA4 实施专家
|
||||
Reference in New Issue
Block a user