feat: webforai.kr 방문 측정 (GTM·GA4) 연결과 처리방침 반영
- discovery 빌드에만 GTM(GTM-WQNTZVZH) 스니펫을 넣는다. GA4(G-013Z3BFY35)와 키 이벤트는 컨테이너 안에서 설정한다 - 문의 접수 성공 시 dataLayer 에 generate_lead(lead_source) 를 보낸다. 개인정보는 넣지 않는다 - GTM 가져오기 파일(docs/analytics/gtm_webforai_import.json): GA4 기본 태그, generate_lead·click_tel·click_email - 개인정보처리방침 제1·5·8조에 Google 애널리틱스 분석 쿠키, 수집 항목, 국외 이전, 거부 방법을 반영한다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f03c6a5b90
commit
c90aef654f
5 files changed
+305
-4
No files matched your search
+13
-1
@@ -41,6 +41,15 @@ export default defineConfig(({mode}) => {
|
||||
'<link rel="apple-touch-icon" href="/discovery-apple-touch-icon.png" />',
|
||||
]
|
||||
: [];
|
||||
// 방문 측정: Google 태그 관리자(GTM) 컨테이너. GA4(G-013Z3BFY35)와 키 이벤트는 컨테이너 안에서 설정한다.
|
||||
// 공개 배포(webforai.kr)에만 넣는다. 컨테이너 ID 는 공개 값이다. 개인정보처리방침 제5·8조와 함께 관리한다.
|
||||
const GTM_ID = 'GTM-WQNTZVZH';
|
||||
const gtmHead = isDiscovery
|
||||
? [`<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${GTM_ID}');</script>`]
|
||||
: [];
|
||||
const gtmBody = isDiscovery
|
||||
? `<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=${GTM_ID}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>`
|
||||
: '';
|
||||
const headHtml = [
|
||||
`<title>${head.title}</title>`,
|
||||
`<meta name="description" content="${head.description}" />`,
|
||||
@@ -50,6 +59,7 @@ export default defineConfig(({mode}) => {
|
||||
`<meta property="og:locale" content="ko_KR" />`,
|
||||
...share,
|
||||
...verify,
|
||||
...gtmHead,
|
||||
].join('\n ');
|
||||
|
||||
return {
|
||||
@@ -78,7 +88,9 @@ export default defineConfig(({mode}) => {
|
||||
{
|
||||
name: 'infinith-head',
|
||||
transformIndexHtml(html: string) {
|
||||
return html.replace(/<title>[\s\S]*?<\/title>/, headHtml);
|
||||
return html
|
||||
.replace(/<title>[\s\S]*?<\/title>/, headHtml)
|
||||
.replace('<body>', gtmBody ? `<body>\n ${gtmBody}` : '<body>');
|
||||
},
|
||||
},
|
||||
tailwindcss(),
|
||||
|
||||
Reference in new issue
Block a user