chore: index.html 중복 메타 태그·gtag·Kakao SDK 정리 (1/6) - #979
Hidden character warning
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
대-승준 👍 |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> | ||
|
|
||
| <!-- Google tag --> | ||
| <script async src="https://www.googletagmanager.com/gtag/js?id=%VITE_GOOGLE_ANALYTICS%"></script> |
There was a problem hiding this comment.
Radar 플러그인이 구글 태그 매니저까지 대체해주는지는 몰랐네..
There was a problem hiding this comment.
저도 이 부분은 처음 알게되었어요..!! 🧐🧐

🏄🏼♂️ Summary (요약)
index.html에 두 번씩 들어가 있던 메타 태그와 스크립트를 한 번으로 정리합니다.🫨 Describe your Change (변경사항)
1. 수동 gtag 블록 제거 (GA는 유지됨)
vite.config.ts의VitePluginRadar가 빌드 시 동일한 gtag 스니펫을<head>최상단에 이미 주입하고 있습니다.2026-03 GA 도입(Google Analytics 이벤트 및 페이지뷰 추적 기능 추가 #852) 때 추가된 수동 블록이 이와 중복되어, 현재 라이브 HTML에는 gtag 스니펫이 2번 들어 있습니다 (
curl https://www.layerapp.io/48행 = 플러그인, 2735행 =수동).gtag('config', 같은 ID)가 매 로드마다 두 번 호출되므로 첫 진입page_view가 중복 집계되고 있을 가능성이 높습니다.page_view를 보내고 있었습니다. 플러그인은 dev에서 주입하지 않으므로(enableDev기본 false) 이것도 함께 해소됩니다.trackPageView/trackEvent는 production에서만 실행되도록 이미 가드되어 있어, dev에서window.gtag가 없어도 호출되지 않습니다.2. 중복 Open Graph / Twitter Card 블록 제거
og:site_name값을layer→Layer로 수정했습니다.3. Kakao SDK 중복 로드 제거
kakao.js와kakao.min.js가 둘 다 로드되고 있었습니다. 압축본(kakao.min.js)만 남겼습니다. 같은 SDK라window.KakaoAPI는 동일합니다.🧐 Issue number and link (참고)
closes: #978
📚 Reference (참조)
curl -s https://www.layerapp.io/ | grep -n gtagvite-plugin-radar주입 조건:transformIndexHtml에서command === "serve" && !enableDev일 때만 건너뜀 (빌드 시 항상 주입)