Skip to main content
@depict-ai/js-ui bundles DPC (Depict Performance Client), so there is nothing extra to install. Import it and initialise it once; the event pages that follow assume dpc is initialised.

Import

Add the import at the top of the file where you initialise DPC:

Initialise

Execute this once in your application, with your merchant id and the market the visitor is browsing:
Both values are case-sensitive; merchant ids are always lowercase. Once DPC is initialised, the dpq global for sending events imperatively is also available. See the DPC reference for more information.

Merchant and market ids

Your merchant id is the first path segment after /v2 in the portal URL: when you’re logged in at app.depict.ai the address looks like app.depict.ai/v2/your-merchant-id/dashboard. It’s always lowercase.
Your market ids are set up together with your data ingestion and appear in the market filters throughout the portal (for example on the Analytics page). Use them exactly as written there — they are case-sensitive. If in doubt, ask your Depict contact.
Consent management: DPC stores a single random visitor identifier in localStorage under the key _dep_id (with a cookie fallback of the same name) and starts sending events as soon as it is initialised — it has no built-in consent gating. If your consent policy requires it, only initialise DPC after the visitor has consented to performance/analytics tracking.