---
title: Build a NetScript exploration
slug: analytics/docs/5i4Z-build-a-netscript-exploration
createdAt: 2026-07-20T15:45:29.316Z
---

The following example shows how to create an exploration to count the number of product events users perform and then categorize them based on the number of interactions they make:

1. In the Catalog, go to **Datasets > Product Events**.
2. Double-click **Product Events** and type **count**. This will display the total number of product events. (Double-clicking anything in the catalog copies the syntax in the builder. )

   ![opti-ns-1.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/OQ7CuAcSEWS0IBlOled5N-20260720-144833.png)
3. To count the number of product events by user, enter **count by** and double-click the **Users** dataset.

   ![opti-ns-2.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/SBqGy9E1f8rsHcv_DIuJU-20260720-144834.png)
4. Save the previous result as a variable called **eventsByUser** and use the **if..then..else** syntax to create bins. Save this as a variable called **eventsByUserBinned**.

   ![opti-ns-3.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/haT8GL97q3CIA-su-lLoR-20260720-144833.png)
5. Double-click **Users** on the catalog and type count by **eventsByUserBinned** to count users by the bin they belong to.
6. Click **Save**.

   ![opti-ns-4.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/4LSJIGyaM_6HiGHv6p9qY-20260720-144834.png)
