Saltar al contenido

Iniciar

  1. Instale el plugin

    Copiar al portapapeles
    npm i @capgo/capacitor-contentsquare
  2. Sincronizar plataformas nativas

    Ventana de terminal
    npx cap sync
  3. Revisar la configuración del producto upstream

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',
});
  • Usar nombres estables en lugar de valores específicos del usuario.
  • Mantener las mismas convenciones de nombramiento en las pilas de navegación de iOS y Android.
  • Cuando la aplicación regrese al primer plano, envíe el nombre de la pantalla y cualquier variable dinámica crítica.

Usar los ayudantes de máscara integrados para mantener el contenido sensible fuera de la Reproducción de Sesión:

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' }],
});
  • 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.