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-facebook-analytics`
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/facebook-analytics/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-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-facebook-analytics` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-facebook-analyticsbunx cap syncImport
Importimport { FacebookAnalytics, FacebookEventName, FacebookEventParameterName,} from '@capgo/capacitor-facebook-analytics';Native Setup
Section titled “Native Setup”Meta 앱 ID와 클라이언트 토큰을 native 앱에서 설정하세요. 플러그인은 이러한 값을 자동으로 생성하지 않습니다.
Meta 값을 추가하세요 Info.plist:
<key>FacebookAppID</key><string>YOUR_FACEBOOK_APP_ID</string><key>FacebookClientToken</key><string>YOUR_FACEBOOK_CLIENT_TOKEN</string><key>FacebookDisplayName</key><string>YOUR_APP_NAME</string>Android
Section titled “Android”Meta 값을 추가하세요 AndroidManifest.xml:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" /><meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" />문자 자원 추가 android/app/src/main/res/values/strings.xml:
<string name="facebook_app_id">YOUR_FACEBOOK_APP_ID</string><string name="facebook_client_token">YOUR_FACEBOOK_CLIENT_TOKEN</string>광고주 추적 활성화
광고주 추적 활성화사용자 동의 흐름이 추적을 허용한 후에 호출하세요.
await FacebookAnalytics.enableAdvertiserTracking();iOS 17 이상에서 FBSDK v17+는 앱 추적성 투명성(App Tracking Transparency)을 직접 읽습니다. 앱의 ATT 흐름을 사용하여 추적에 의존하는 이벤트를 로깅하기 전에 사용하세요.
표준 이벤트 로깅
표준 이벤트 로깅await FacebookAnalytics.logEvent({ event: FacebookEventName.CompletedRegistration, params: { [FacebookEventParameterName.RegistrationMethod]: 'email', },});__CAPGO_KEEP_0__ 이벤트 로그하기 (통화)
__CAPGO_KEEP_1__ 제목: __CAPGO_KEEP_0__ 이벤트 로그하기 (통화)await FacebookAnalytics.logEvent({ event: FacebookEventName.AddedToCart, valueToSum: 19.99, currency: 'USD', params: { [FacebookEventParameterName.ContentType]: 'product', [FacebookEventParameterName.ContentId]: 'sku-123', },});__CAPGO_KEEP_2__ 구매 로그하기
__CAPGO_KEEP_3__ 제목: __CAPGO_KEEP_2__ 구매 로그하기await FacebookAnalytics.logPurchase({ amount: 9.99, currency: 'USD',});__CAPGO_KEEP_4__ 추적 상태 읽기
__CAPGO_KEEP_5__ 제목: __CAPGO_KEEP_4__ 추적 상태 읽기const { status } = await FacebookAnalytics.getAdvertiserTrackingStatus();console.log('Advertiser tracking enabled:', status);__CAPGO_KEEP_6__ 진실의 근원
__CAPGO_KEEP_7__ 제목: __CAPGO_KEEP_6__ 진실의 근원이 페이지는 플러그인의 __CAPGO_KEEP_8__ 에 의해 생성되었습니다. src/definitions.ts. API이 업스트림에서 변경되면 다시 싱크를 실행하세요.
Getting Started에서 계속하기
Getting Started에서 계속하기란Capgo를 사용하는 경우 Getting Started Capgo를 사용하여 네이티브 플러그인 작업을 계획할 때, __CAPGO_KEEP_0__-facebook-analytics와 연결하세요. Capgo를 사용하여 네이티브 기능인 Using @capgo/capacitor-facebook-analytics를 사용할 때, for the native capability in Using @capgo/capacitor-facebook-analytics, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, 플러그인 추가 또는 업데이트 __CAPGO_KEEP_0__ 아이오닉 엔터프라이즈 플러그인 대체 __CAPGO_KEEP_0__