Server-side GTM Guide
sGTM 아키텍처 옵션 및 설정 가이드.
Why Server-side GTM?
| Benefit |
Description |
| Data Control |
클라이언트 → 서버 → 벤더 흐름 제어 |
| Privacy |
PII 필터링, 서버에서 처리 |
| Cookie Duration |
1st-party cookie (최대 2년) |
| Performance |
클라이언트 JS 감소 |
| Reliability |
Ad blocker 영향 최소화 |
Architecture Options
Option 1: GCP Cloud Run
- Pros: 완전한 제어, GCP 통합
- Cons: GCP 전문 지식 필요
- Cost: Low ~$20, Medium ~$100, High $200+/월
Option 2: Stape.io (Managed)
- Pros: 간편 설정 (10분), 관리형, 한국 리전
- Cons: 월정액, 벤더 종속
- Cost: Starter $20, Business $50, Scale $150/월
Option 3: Google Tag Gateway
- Pros: Google 관리형, 무료(제한적)
- Cons: Google 태그만 지원, 제한된 커스터마이징
Selection Guide
| Requirement |
Recommendation |
| Google 태그만 |
Tag Gateway |
| 빠른 구현 |
Stape.io |
| 완전한 제어 |
GCP Cloud Run |
| Third-party 태그 (Meta 등) |
Stape 또는 GCP |
Client Configuration
Web Container 설정
GTM GA4 Configuration Tag
Stape Quick Setup
- 계정 생성: stape.io
- Container 생성: Region = Seoul (asia-northeast3)
- Custom Domain 연결
- GTM Server Container ID 연결
- Web Container 수정: server_container_url 추가
Server Tags
GA4 Tag
Google Ads Conversion
Meta Conversions API
Testing
- Preview Mode: GTM Server Container → Preview
- Validation:
- Client → Server 요청 도달
- Server → Platform 전송 확인
- Cookie 설정 확인 (1st-party)
- Latency < 200ms
Common Issues
| Issue |
Solution |
| 요청 미도달 |
CORS, Custom domain 확인 |
| Cookie 미설정 |
Same-site 정책, 도메인 확인 |
| Timeout |
리전 최적화, 스케일링 |