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.
설치
설치bun add @capgo/capacitor-gtmbunx cap syncImport
Import 섹션import { GoogleTagManager } from '@capgo/capacitor-gtm';API 개요
API 개요 섹션initialize
__CAPGO_KEEP_2__Google Tag Manager를 지정된 컨테이너 ID와 초기화합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.initialize({} as { containerId: string; timeout?: number });push
__CAPGO_KEEP_3____CAPGO_KEEP_3__ 섹션
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
Section titled “getValue”Google Tag Manager dataLayer에서 지정된 키의 최신 값을 검색하여 가져옵니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.getValue({} as { key: string });Google Tag Manager 인스턴스를 초기화하고 모든 데이터를 삭제합니다.
import { GoogleTagManager } from '@capgo/capacitor-gtm';
await GoogleTagManager.reset();클립보드에 복사
실질적인 출처Section titled “Source Of Truth” src/definitions.ts. upstream의 API이 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting Started에서 계속하는 섹션Capacitor를 사용하는 경우 Getting Started Capacitor를 사용하여 대시보드와 API를 계획하고 운영하기 위해 연결하세요. Capacitor를 사용하여 @capgo/capacitor-gtm Capacitor를 사용하여 @capgo/capacitor-gtm의 네이티브 기능 API 개요 API 개요의 구현 세부 정보 __CAPGO_KEEP_0__ 개요 소개 API 키 implementation 세부 정보에 대한 API 키 장치 implementation 세부 정보에 대한 장치