跳过内容

开始

GitHub

您可以使用我们的 AI 助手设置来安装插件。使用以下命令将 Capgo 技能添加到您的 AI 工具中:

终端窗口
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-contentsquare` plugin in my project.

如果您更喜欢手动设置,请按照以下命令安装插件并遵循以下平台特定的说明:

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

重播隐私控制

重播隐私控制部分

使用内置的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' }],
});

平台设置

平台设置部分
  • 对于 iOS 内嵌功能,完成额外的 deeplink 编程在 iOS 设置 页面中。
  • Android 不需要为插件本身进行额外的清单编程;见 安卓笔记 用于日志和验证提示.
  • 本插件是Capacitor 8社区版的官方ContentsquareCapacitor包的翻译.
  • JavaScriptAPI与当前ContentsquareCapacitor文档保持一致,而打包和本机构建设置则针对Capacitor 8.

如果您正在使用 开始 来规划本机插件工作,连接它到 使用@capgo/capacitor-contentsquare 为使用 @capgo/capacitor-contentsquare 的原生能力 Capgo 插件目录 为 Capgo 插件目录中的产品工作流 Capacitor 由 Capgo 提供的插件 为 Capacitor 由 Capgo 提供的插件中的实现细节 添加或更新插件 为添加或更新插件中的实现细节, Ionic 企业插件替代方案 为 Ionic 企业插件替代方案中的产品工作流