Skip to content

Capacitor & Ionic

Capacitor and Ionic apps load the web view from capacitor://localhost (or ionic://localhost on older setups). In both cases the page’s hostname is literally localhost, even though this is a production app on someone’s phone rather than a dev server.

Enable the project’s “Allow local origins” toggle (dashboard → Settings) so ingest and the widget/SDK’s CORS layer accept it. The toggle covers localhost, 127.0.0.1, and *.localhost origins for the project.

<script src="https://cdn.analytics.canarycoders.es/lytics.js" data-domain="myapp.com" defer></script>

data-domain should still be your real production domain (or whatever value you want events grouped under). The toggle is about which Origin is trusted, not what domain the snippet reports.