__CAPGO_KEEP_0__
复制一个包含安装步骤和完整 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.
-
安装插件
笔记稿百 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 -
Review the upstream product configuration
遵循官方 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 导航堆栈中的命名约定一致
- 当应用返回前台时,重新发送屏幕名称和任何关键动态变量
Replay privacy controls
Section titled “Replay privacy controls”使用内置的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' }],});- For iOS in-app features, complete the extra deeplink wiring in the iOS应用内功能的设置需要额外的深度链接编程, iOS设置
- 页面。 Android不需要为插件本身进行额外的清单编程;请参阅 Android注意事项
- 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继续
Section titled “Keep going from Getting Started”如果您正在使用 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 企业插件替代方案中。