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.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-gtmbunx cap syncImport
Import 섹션import { GoogleTagManager } from '@capgo/capacitor-gtm';API 개요
API 개요 섹션initialize
초기화Google Tag Manager를 지정된 컨테이너 ID와 함께 초기화합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.initialize({} as { containerId: string; timeout?: number });push
초기화 섹션Google Tag Manager 데이터 레이어에 이벤트를 푸시합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.push({ event: 'purchase', parameters: { value: 99.99, currency: 'USD' }});setUserProperty
사용자 속성을 설정하는 섹션Google Tag Manager 데이터 레이어에 사용자 속성을 설정합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.setUserProperty({ key: 'user_type', value: 'premium'});getValue
값을 가져오는 섹션Google Tag Manager 데이터 레이어에서 값을 가져옵니다. 지정된 키의 최신 값으로 데이터 레이어를 검색합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.getValue({} as { key: string });클립보드에 복사
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.reset();__CAPGO_KEEP_0__
Source Of Truth이 페이지는 플러그인의 src/definitions.ts. 업스트림의 공공 API이 변경되었을 때 다시 싱크를 실행하세요.
Getting Started
Getting StartedGetting Started Getting Started to plan dashboard and API operations, connect it with Using @capgo/capacitor-gtm for the native capability in Using @capgo/capacitor-gtm, API Overview for the implementation detail in API Overview, __CAPGO_KEEP_0__ Introduction API Keys API Keys Capgo 구현 세부 사항에 대한 설명 Devices