Product Analytics
Product Analytics (PA) captures and visualizes user interactions across web, mobile, and other platforms, providing insights into user behavior and engagement. This data helps you identify user preferences, pain points, and behavior patterns so you can improve and optimize the digital experience.
For more information, see our product ↗ and pricing ↗ pages.
If you enforce a Content Security Policy, see Content Security Policy for the directives required by the Contentsquare Tag.
No additional CSP directives are required for the PA features described on this page.
Privacy
Section titled PrivacyMasking and encrypted elements defined in the Contentsquare tracking tag are also enforced for PA data collection. See Personal Data Handling.
For projects with IP-less mode active, IP processing is also disabled for PA data collection.
Page title masking
Section titled Page title maskingYou can keep page titles out of PA collection with the following commands:
| Command | Description |
|---|---|
hidePageTitle | Replaces the page title with **** in the next or all next pageviews. |
resetHidePageTitle | Reverts hidePageTitle for the next pageviews. |
PA Tag commands
Section titled PA Tag commandsActivating Product Analytics unlocks the following groups of Tag commands. All PA commands are called through window._uxa.push(...), the same interface used for standard Tag commands.
See Command reference for full syntax and examples.
Custom event commands
Section titled Custom event commandsCustom event commands let you send your own named events, enriched with custom properties, alongside the interactions Contentsquare captures automatically.
| Command | Description |
|---|---|
trackEvent | Sends a custom event with a name and optional properties. |
Identity commands
Section titled Identity commandsIdentity commands let you attach a unique identifier to the current user for cross-device and cross-session analysis.
| Command | Description |
|---|---|
identify | Associates the current user with the provided identity string. If a different identity is already set, the session is reset: the user ID is regenerated and a renewal pageview is sent. |
resetIdentity | Detaches the identity string from the current user and resets the session. |
getIdentity | Returns whether the current user has an identity string associated with them. |
For more information on user identification, see Track Users.
User property commands
Section titled User property commandsUser property commands let you attach custom key-value properties to the current user. These properties are associated with all future events for that user.
| Command | Description |
|---|---|
addUserProperties | Attaches custom properties to the current user, overwriting any previously set values for the same properties. |
Event property commands
Section titled Event property commandsEvent property commands let you attach custom key-value properties to all subsequent events in the current visit.
| Command | Description |
|---|---|
customProperties:visit:add | Adds custom properties to all subsequent events. Alias: addEventProperties. |
customProperties:visit:remove | Removes a specific custom property from subsequent events. Alias: removeEventProperty. |
customProperties:visit:clear | Removes all custom properties from subsequent events. Alias: clearEventProperties. |
Pageview property commands
Section titled Pageview property commandsPageview property commands let you attach custom key-value properties to the current pageview and all events on that page.
| Command | Description |
|---|---|
customProperties:page:add | Adds custom properties to the current pageview and its events. |
customProperties:page:remove | Removes a specific custom property from the current pageview. |
customProperties:page:clear | Clears all custom properties from the current pageview. |
Element hierarchy collection
Section titled Element hierarchy collectionTo power interaction analysis, the Tag enriches click, tap, change, and submit events with the element hierarchy: the chain of ancestor elements from the interacted element up to the document root. Each level collects the tag name and a limited set of attributes.
Hierarchy collection respects your project's masking settings. Attributes that commonly hold sensitive or non-semantic data are never collected, including:
- Password manager attributes (for example, 1Password's
data-com.onepassword.iv). - Library attributes that can hold personal data (for example,
data-initial-valuefrom v-mask). - Inline scripts and styles (
onclick,onsubmit,style). - Framework-internal attributes with no analytical value (for example,
data-reactid).
Session context collection
Section titled Session context collectionMost PA reporting relies on session-level context — when a visit started and where it came from — being attached to every event, not just the first pageview. The Tag persists this context client-side in the _cs_s_ctx cookie and replays it as request parameters on each subsequent pageview and event:
| Stored value | Sent as | Purpose |
|---|---|---|
firstViewTime | fvt | When the session started. |
firstViewUrl | fvurl | The session's landing page. |
sessionReferrer | fpvurl | The session's traffic source. |
This cookie is created only when Product Analytics is active on the project. It has no effect on Experience Analytics features such as Session Replay or heatmaps.
Impact of blocking _cs_s_ctx
Section titled Impact of blocking _cs_s_ctxIf _cs_s_ctx is blocked or stripped — by a WAF rule, a cookie allowlist, or a Consent Management Platform — the Tag cannot restore session context after the first pageview. Landing page, traffic source, and session-start time are then missing from every later event, which degrades attribution and the overall quality of PA reporting for the affected sessions.
To avoid this, add _cs_s_ctx to any cookie filter you enforce — see Server configuration below.
PA cookies
Section titled PA cookiesWhen Product Analytics is activated, the following cookies are created in addition to the standard Tag cookies:
| Cookie | Duration | Description |
|---|---|---|
_cs_s_ctx | 30 minutes | Stores session context data (first pageview time, URL, and referrer). |
_cs_i | 3 days | Stores the encrypted user identity string set via the identify command. |
_cs_ep | 13 months | Stores visit-level custom event properties set via customProperties:visit:add. |
Server configuration
Section titled Server configurationThese cookies are new when Product Analytics is activated and are not present in a standard Tag deployment. If you have an existing cookie filter, update it before activating PA features.
If you enforce a cookie allowlist — through a Consent Management Platform (CMP), a WAF, or server-side filtering rules — add _cs_s_ctx, _cs_i, and _cs_ep to that list. Blocking any of them prevents Product Analytics from collecting data correctly.
_cs_ep grows with the number of custom event properties set. Combined with _cs_s_ctx, the total Cookie request header size can exceed limits enforced by reverse proxies or web servers. If your infrastructure enforces a header size limit, make sure it accommodates at least 4 KB for cookies.
For more information, see Cookies.