はじめに
このプラグインのインストール手順と全マークダウンガイドを含む設定の質問をコピーしてください。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-contentsquare`
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/contentsquare/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.
-
プラグインをインストール
クリップボードにコピー npm i @capgo/capacitor-contentsquare__CAPGO_KEEP_0__ pnpm add @capgo/capacitor-contentsquareターミナル画面 yarn add @capgo/capacitor-contentsquareターミナル画面 bun add @capgo/capacitor-contentsquare -
ネイティブプラットフォームを同期
ターミナル画面 npx cap syncターミナル画面 pnpm cap syncターミナル画面 yarn cap syncターミナル画面 bunx cap sync -
アップストリーム製品の設定を確認する
公式の Contentsquare Capacitor ガイド プロジェクトキー、再生設定、ダッシュボードの設定について
基本的な使用方法
「基本的な使用方法」のセクションimport { ContentsquarePlugin, CurrencyCode } from '@capgo/capacitor-contentsquare';
await ContentsquarePlugin.optIn();
await ContentsquarePlugin.sendScreenName('Home');
await ContentsquarePlugin.sendTransaction({ transactionValue: 29.99, transactionCurrency: CurrencyCode.EUR, transactionId: 'order-123',});
await ContentsquarePlugin.sendDynamicVar({ dynVarKey: 'store', dynVarValue: 'rome',});画面の命名のヒント
「画面の命名のヒント」のセクション- 安定した名前を使用するのではなく、ユーザー固有の値を使用しないようにします。
- iOS と Android のナビゲーション スタックで同じ命名規則を維持するようにします。
- アプリが前景に戻ったときに、画面名と重要なダイナミック変数を再送信するようにします。
再生プライバシー制御
「再生プライバシー制御」のセクションセッション再生から敏感なコンテンツを除外するために、組み込みのマスク ヘルパーを使用します。
await ContentsquarePlugin.excludeURLForReplay('/checkout/');
await ContentsquarePlugin.setCapturedElementsSelector('[data-cs-capture]');
await ContentsquarePlugin.setPIISelectors({ PIISelectors: ['input[type="email"]', '.credit-card'], Attributes: [{ selector: 'input[name="email"]', attrName: 'value' }],});プラットフォームのセットアップ
「プラットフォームのセットアップ」のセクション- iOSアプリ内機能のために、追加のデープリンクの設定を行うには、 iOS設定 ページを参照してください。
- Androidでは、プラグイン自体のための追加のマニフェストの設定は必要ありません。ログと検証のためのヒントについては、 Androidの注記 を参照してください。
- This plugin is a Capacitor 8 community port of the official Contentsquare Capacitor package.
- The JavaScript API stays aligned with the current Contentsquare Capacitor docs, while the packaging and native build setup target Capacitor 8.