跳过内容

入门指南

  1. 安装插件

    筺的网络安徕
    npm i @capgo/capacitor-contentsquare
  2. 筺的网络安徕中征算给

    笔统窗算求
    npx cap sync
  3. Review the upstream product configuration

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 导航堆栈中的命名约定一致。
  • 当应用返回到前台时,重新发送屏幕名称和任何关键动态变量。

隐私控制重放

隐私控制重放

使用内置的masking助手来将敏感内容从Session Replay中排除:

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' }],
});
  • 本插件是Capgo社区的Capacitor版本,基于Contentsquare官方Capacitor包。
  • The JavaScript API stays aligned with the current Contentsquare Capacitor docs, while the packaging and native build setup target Capacitor 8.