跳过内容

开始使用

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内应用程序功能,完成额外的深度链接编程在 iOS设置 页面。
  • Android不需要为插件本身进行额外的清单编程;请参阅 Android注意事项 for logging and validation tips.
  • 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

继续Getting Started

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