跳过内容

__CAPGO_KEEP_0__

GitHub
  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' }],
});
  • 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.

如果您正在使用 Getting Started 来规划原生插件工作,连接它与 Using @capgo/capacitor-contentsquare for the native capability in Using @capgo/capacitor-contentsquare, Capgo Plugin Directory 为产品工作流程在 Capgo 插件目录中, Capacitor 插件由 Capgo 为 Capacitor 插件的实现细节在 Capgo 添加或更新插件 为添加或更新插件的实现细节,和 Ionic 企业插件替代方案 为产品工作流程在 Ionic 企业插件替代方案中。