Zum Inhalt springen

Getting Started

Dieser Inhalt ist in Ihrer Sprache noch nicht verfügbar.

  1. Install the plugin

    Terminal-Fenster
    npm i @capgo/capacitor-contentsquare
  2. Sync native platforms

    Terminal-Fenster
    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',
});
  • Use stable names instead of user-specific values.
  • Keep the same naming conventions across iOS and Android navigation stacks.
  • When the app returns to foreground, resend the screen name and any critical dynamic variables.

Use the built-in masking helpers to keep sensitive content out of 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 setup page.
  • Android does not need extra manifest wiring for the plugin itself; see Android notes 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.