---
title: Product Analytics - WebView
description: Product Analytics capabilities made available for users of the CSQ SDK within WebViews
lastUpdated: 11 March 2026
source_url:
  html: https://docs.contentsquare.com/en/webview-tracking-tag/product-analytics/
  md: https://docs.contentsquare.com/en/webview-tracking-tag/product-analytics/index.md
---

The following Product Analytics capabilities are available in WebViews **only if** you use the CSQ SDK.

If you are running the Contentsquare or Heap SDK, upgrade to the CSQ SDK first:

* [From Contentsquare SDK (iOS)](https://docs.contentsquare.com/en/csq-sdk-ios/experience-analytics/upgrade-from-cs-sdk/)
* [From Heap SDK (iOS)](https://docs.contentsquare.com/en/csq-sdk-ios/product-analytics/upgrade-from-heap-core-sdk/)
* [From Contentsquare SDK (Android)](https://docs.contentsquare.com/en/csq-sdk-android/experience-analytics/upgrade-from-cs-sdk/)
* [From Heap SDK (Android)](https://docs.contentsquare.com/en/csq-sdk-android/product-analytics/upgrade-from-heap-core-sdk/)
* [From Contentsquare SDK (Android)](https://docs.contentsquare.com/en/csq-sdk-react-native/experience-analytics/upgrade-from-cs-sdk/)
* [From Heap SDK (Android)](https://docs.contentsquare.com/en/csq-sdk-react-native/product-analytics/upgrade-from-heap-core-sdk/)

## Track users

Required configuration

* `CS_CONF.heapEnvironment?.heap_tag_status === cs_crosswrites_heap`

Link a user's activity across all devices and sessions with a consistent internal identifier (like a User ID or hashed email), effectively moving beyond cookie restrictions. This creates a single, unified view of the customer journey, enabling deep cross-device analysis, enhanced segmentation based on known user attributes, and seamless audience activation by integrating behavioral data with external tools like your CRM.

The `identify` command associates the current user with a unique identifier you provide.

```javascript
window._uxa.push(["identify", <identityString>, <options>]);
```

For example, you can identify users with:

* A User ID from your CRM

  ```html
  <script type="text/javascript">
    window._uxa = window._uxa || [];


    // crmUserID = 145612124
    window._uxa.push(["identify", crmUserID]);
  </script>
  ```

* A hashed user email address

  ```html
  <script type="text/javascript">
    window._uxa = window._uxa || [];


    // hashedEmail = bfuKr7A9WgrhAgm2:C2YFJWcfN1yXzUnPfMrv6JivXJvYw==
    window._uxa.push(["identify", hashedEmail]);
  </script>
  ```

Session reset

Calling `identify` for a user who is already identified with a different identity resets the current session, generates a new user ID, and sends a renewal pageview.

Calling `identify` for a user who is already identified with the same identity does **not** reset the session.

```html
<script type="text/javascript">
  window._uxa.push(["identify", crmUserID1]);
  // Contentsquare user ID = 123
  // Identity = uuid1


  // ...


  window._uxa.push(["identify", crmUserID2]);
  // Contentsquare user ID = 456
  // Identity = uuid2
  // Session reset, new user ID and renewal pageview


  // ...


  window._uxa.push(["identify", crmUserID2]);
  // Contentsquare user ID = 456
  // Identity = uuid2
  // No session reset
</script>
```

## Add user properties

Required configuration

* `CS_CONF.heapEnvironment?.heap_tag_status === cs_crosswrites_heap`

Attach properties to users to allow contextual, cross-device, and cross-platform analysis such as finding users with the payment plan X in the past month. User properties can be attached to both anonymous and identified users.

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];


  // hashedEmail = bfuKr7A9WgrhAgm2:C2YFJWcfN1yXzUnPfMrv6JivXJvYw==
  window._uxa.push(["identify", hashedEmail]);


  // userProperties = { "accountType": "Premium", "membershipLevel": 3 }
  window._uxa.push(["addUserProperties", userProperties]);
</script>
```

## Reset identity

Resets the current session and generate a new user ID if the user has an identity string associated with them.

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];


  // user identity = 9fae2d84-37e7-4321-9b26-793d1665e887
  window._uxa.push(["resetIdentity"]);


  // new user identity = 4b5c6e21-2f4a-4c3d-8f1e-8b9d7e5c3a1f
</script>
```

## Hierarchies

Required configuration

* `CS_CONF.collectHierarchy === true`

Hierarchies identify an event's origin within the current screen. They help understanding how users interact with different parts of your website, such as product categories, blog sections, or service pages.

Hierarchies are collected automatically within WebViews.

Considering the following component:

```jsx
const PinView = (props) => {
  return (
    <View>
      <Button title="1" rounded />
      <Button title="2" rounded />
      ...
    </View>
  );
};
```

Tapping the button "1" would generate the hierarchy: `PinView Button[title=1][rounded=true]`.

## Target text

Required configuration

* `CS_CONF.collectTargetText === 2`

Target text is the automatic collection of text content of an element a user interacts with. It captures the actual text displayed within clickable elements like buttons, links, and similar UI components.

For example, if a user clicks on a button that says "Sign Up", the Target Text property would capture "Sign Up" as the value.

This can be enabled in one of two ways:

* Collect text of buttons or links: A button or a link text that users have or have not clicked on.
* Collect text of all elements: Any element containing text that users have or have not clicked on (includes buttons and links).

This applies to `tap`, `click`, and `submit` events. Target text is collected up to 100 characters.
