Skip to content

Getting Started

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Terminal window
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-contentsquare` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

  1. Install the plugin

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

    Terminal window
    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.

If you are using Getting Started to plan native plugin work, connect it with 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 for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.