Page/area: Capgo marketing website. Role: Website copy sentence. Seen in: component Hero.astro. Message key `hero_subtitle_v2` (Hero Subtitle V2).
复制一个包含安装步骤和本插件完整Markdown指南的配置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-contentsquare`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/contentsquare/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
标题:安装您可以使用我们的 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.如果您prefer手动设置,安装插件并运行以下命令并遵循以下平台特定说明:
-
安装插件
笔统窗籿东 npm i @capgo/capacitor-contentsquare笔统窗籿东 pnpm add @capgo/capacitor-contentsquare笔统窗籿东 yarn add @capgo/capacitor-contentsquare笔统窗籿东 bun add @capgo/capacitor-contentsquare -
合成合端籿东
笔统车稿 npx cap sync笔统车稿 pnpm cap sync笔统车稿 yarn cap sync笔统车稿 bunx cap sync -
查看上游产品配置
遵循官方 Contentsquare Capacitor 指南 获取项目密钥、重播设置和仪表板设置。
基本使用
标题:基本使用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重放中:
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不需要额外的清单编程来为插件本身;请参见 Android注意事项 以获取日志和验证提示。
注意
标题:注意- This plugin is a Capacitor 8 community port of the official Contentsquare Capacitor package.
- JavaScriptAPI与当前ContentsquareCapacitor文档保持一致,而包装和本机构建设置则针对Capacitor 8。
继续从Getting Started
标题:继续从Getting Started如果您正在使用 开始使用 来规划本机插件工作,连接它到 使用@capgo/capacitor-contentsquare 为在使用@capgo/capacitor-contentsquare中实现本机能力 Capgo插件目录 为 Capgo 产品工作流程 Capacitor 插件由 Capgo 为 Capacitor 插件的实现细节了解 Capgo 添加或更新插件 为添加或更新插件的实现细节, 和 Ionic 企业插件替代品 为 Ionic 企业插件替代品的产品工作流程