Skip to content

chore: index.html 중복 메타 태그·gtag·Kakao SDK 정리 (1/6) - #979

Merged
prgmr99 merged 1 commit into
847-ops-seo-검토-및-개선-2from
978-ops-seo-16-indexhtml-중복-메타-태그스크립트-정리
Sep 20, 2026

Hidden character warning

The head ref may contain hidden characters: "978-ops-seo-16-indexhtml-\uc911\ubcf5-\uba54\ud0c0-\ud0dc\uadf8\uc2a4\ud06c\ub9bd\ud2b8-\uc815\ub9ac"
Merged

prgmr99 merged 1 commit into
847-ops-seo-검토-및-개선-2from
978-ops-seo-16-indexhtml-중복-메타-태그스크립트-정리

Conversation

@prgmr99

@prgmr99 prgmr99 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

🏄🏼‍♂️‍ Summary (요약)

  • index.html에 두 번씩 들어가 있던 메타 태그와 스크립트를 한 번으로 정리합니다.
  • GA, OG, Kakao SDK 모두 그대로 동작하고, 중복분만 제거됩니다.

🫨 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가 중복 집계되고 있을 가능성이 높습니다.
  • 수동 블록은 dev 서버에서도 실행돼 로컬 세션이 프로덕션 GA 속성으로 page_view를 보내고 있었습니다. 플러그인은 dev에서 주입하지 않으므로(enableDev 기본 false) 이것도 함께 해소됩니다.
  • trackPageView / trackEvent는 production에서만 실행되도록 이미 가드되어 있어, dev에서 window.gtag가 없어도 호출되지 않습니다.

2. 중복 Open Graph / Twitter Card 블록 제거

  • 같은 내용의 블록이 2회 선언되어 있어 두 번째 블록을 삭제했습니다. 봇마다 어느 값을 읽는지 예측할 수 없던 상태를 정리합니다.
  • og:site_name 값을 layer → Layer로 수정했습니다.

3. Kakao SDK 중복 로드 제거

  • kakao.js와 kakao.min.js가 둘 다 로드되고 있었습니다. 압축본(kakao.min.js)만 남겼습니다. 같은 SDK라 window.Kakao API는 동일합니다.

🧐 Issue number and link (참고)

closes: #978

📚 Reference (참조)

  • 중복 gtag 스니펫 확인: curl -s https://www.layerapp.io/ | grep -n gtag
  • vite-plugin-radar 주입 조건: transformIndexHtml에서 command === "serve" && !enableDev일 때만 건너뜀 (빌드 시 항상 주입)

@prgmr99 prgmr99 self-assigned this Sep 17, 2026
@prgmr99 prgmr99 added the 🧹 refactor 사용자에게는 드러나지 않는 코드 상의 변화 label Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • Not Rabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c192e611-2865-4f51-a978-79a7095d1029

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title chore: #978 SEO 메타 태그 정리 및 Google Analytics 스크립트 제거 초기 로딩 성능 개선 및 불필요 코드 제거 Sep 17, 2026
@prgmr99

prgmr99 commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

참고)

image

@prgmr99 prgmr99 changed the title 초기 로딩 성능 개선 및 불필요 코드 제거 chore: index.html 중복 메타 태그·gtag·Kakao SDK 정리 Sep 17, 2026
@prgmr99 prgmr99 changed the title chore: index.html 중복 메타 태그·gtag·Kakao SDK 정리 chore: index.html 중복 메타 태그·gtag·Kakao SDK 정리 (1/6) Sep 17, 2026
@klmhyeonwoo

Copy link
Copy Markdown
Member

대-승준 👍

Comment thread apps/web/index.html
<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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Radar 플러그인이 구글 태그 매니저까지 대체해주는지는 몰랐네..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 이 부분은 처음 알게되었어요..!! 🧐🧐

@prgmr99
prgmr99 merged commit caced96 into 847-ops-seo-검토-및-개선-2 Sep 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 refactor 사용자에게는 드러나지 않는 코드 상의 변화

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants