Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시문을 복사할 수 있습니다.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-gtm`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/gtm/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치란 제목Capgo의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 다음 명령어를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-gtm` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요.
bun add @capgo/capacitor-gtmbunx cap syncImport
Import 섹션import { GoogleTagManager } from '@capgo/capacitor-gtm';API 개요
API 개요 섹션initialize
initialize 섹션지정된 컨테이너 ID와 함께 Google Tag Manager를 초기화합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.initialize({} as { containerId: string; timeout?: number });push
푸시Google 태그 매니저 데이터 레이어에 이벤트를 푸시합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.push({ event: 'purchase', parameters: { value: 99.99, currency: 'USD' }});setUserProperty
사용자 속성을 설정합니다.클립보드 복사
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.setUserProperty({ key: 'user_type', value: 'premium'});getValue
클립보드 복사Google 태그 매니저 인스턴스를 초기화하고 모든 데이터를 삭제합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.getValue({} as { key: string });reset
__CAPGO_KEEP_0____CAPGO_KEEP_1__
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.reset();원본의 진실
원본의 진실이 페이지는 플러그인의 src/definitions.ts공개 API이 upstream에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting Started에서 계속이 플러그인을 사용하는 경우 Getting Started 계획 대시보드 및 API 운영을 위해 Using @capgo/capacitor-gtm Using @capgo/capacitor-gtm API 개요 구현 세부 정보에 대한 API 소개 소개 구현 세부 정보에 대한 소개 API 키 구현 세부 정보에 대한 API 키 및 장치 구현 세부 정보에 대한 장치