コンテンツにスキップ

はじめに

  1. プラグインをインストール

    ターミナルウィンドウ
    npm i @capgo/capacitor-contentsquare
  2. ネイティブプラットフォームの同期

    ターミナル画面
    npx cap sync
  3. アップストリーム製品の設定を確認する

基本的な使用方法

基本的な使用法
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のノート でログと検証のヒントを参照してください。
  • JavaScriptのCapacitorは、現在のContentsquareCapacitorドキュメントと同期されます。
  • The JavaScript API stays aligned with the current Contentsquare Capacitor docs, while the packaging and native build setup target Capacitor 8.