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.
설치
설치설치 단계를 사용하여 플러그인을 설치할 수 있습니다. 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
초기화지정된 container ID와 함께 Google Tag Manager를 초기화합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.initialize({} as { containerId: string; timeout?: number });push
푸시지정된 container ID와 함께 Google Tag Manager의 dataLayer에 이벤트를 푸시합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.push({ event: 'purchase', parameters: { value: 99.99, currency: 'USD' }});setUserProperty
사용자 속성을 Google Tag Manager의 dataLayer에 설정합니다.클립보드에 복사
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.setUserProperty({ key: 'user_type', value: 'premium'});getValue
클립보드에 복사dataLayer에서 지정된 키의 최신 값을 검색하여 값을 가져옵니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.getValue({} as { key: string });Google Tag Manager 인스턴스를 초기화하고 모든 데이터를 삭제합니다. 이 작업은 dataLayer의 모든 데이터를 삭제하고 재초기화를 필요로 합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.reset();진실의 근원
Section titled “진실의 근원”이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Section titled “Getting Started에서 계속”Capgo를 사용 중이라면 Getting Started 대시보드와 API를 계획하고 운영하기 위해 연결하세요. Using @capgo/capacitor-gtm for the native capability in Using @capgo/capacitor-gtm API 개요 for the implementation detail in API 개요 소개 for the implementation detail in 소개 API 키 for the implementation detail in API 키 장치 for the implementation detail in 장치