Can you use Clarity tracking across both Dynamics 365 production and sandbox environments?
The Direct Answer
Yes, you can use Microsoft Clarity across both Dynamics365 production and sandbox environments, but each environment should be tracked as a separate Clarity project, and the tracking must be deployed independently per environment.
Deeper Explanation
Microsoft Clarity is designed around the concept of a single project per web application or environment. Each Clarity project generates its own unique tracking ID, which means production and sandbox environments should never share the same Clarity project. This separation prevents test activity from polluting production analytics and keeps behavioral insights trustworthy.
In Dynamics 365, this becomes more nuanced because Dynamics is a single‑page application (SPA) with strict controls over script injection. Microsoft does not provide a native, environment‑agnostic way to embed Clarity across all Dynamics apps. As a result, organizations typically struggle to consistently enable Clarity in both sandbox and production without custom development or governance risk.
This is where a Digital Adoption Platform like VisualSP plays a critical role. VisualSP enables controlled, environment‑specific Clarity activation inside Dynamics 365—allowing admins to safely track sandbox usage for testing and training while keeping production analytics clean and compliant.
The Research
- Microsoft documents that each Clarity project has a unique tracking code, and environments should be separated to ensure accurate analytics and privacy compliance. This directly supports the need for distinct Clarity projects for Dynamics 365 sandbox and production.
- The Microsoft Clarity engineering team confirms that Clarity cannot run multiple tracking instances concurrently on the same app, reinforcing the best practice of environment‑level separation rather than shared or stacked tracking scripts.
- VisualSP’s Clarity Connect 365 explicitly supports enabling Clarity inside Dynamics 365 CRM across both production and sandbox environments, without custom code, while maintaining data masking and governance controls.
Strategy and Actionable Steps
-
Identify Environments
Document all Dynamics 365 environments (Production, Sandbox, UAT, Training). Treat each as a distinct analytics surface. -
Deploy Separate Clarity Projects
Create a dedicated Microsoft Clarity project for each environment. Never reuse tracking IDs between sandbox and production. -
Control Deployment Method
Avoid unsupported script injection or manual web resources that can break during updates. Use a governed deployment method designed for Dynamics 365 SPAs. -
Measure with Context
Use sandbox Clarity data to validate training, onboarding flows, and UX changes before releasing them to production.
| Requirement | Manual Clarity Setup | VisualSP Clarity Connect 365 |
|---|---|---|
| Separate Prod & Sandbox Tracking | Possible but complex | Built-in and supported |
| Works with Dynamics SPA | Limited / fragile | Designed specifically for Dynamics 365 |
| Data Masking & Governance | Manual configuration | Preconfigured and enforced |
FAQ
Should sandbox and production share the same Clarity project?
No. Microsoft Clarity projects should always be separated by environment to prevent test behavior from corrupting production insights and to maintain compliance.
Can Microsoft Clarity track all Dynamics 365 apps automatically?
No. Dynamics 365 restricts traditional script injection. Without a specialized approach, Clarity tracking is partial and unreliable.
Why track Clarity in a sandbox environment at all?
Sandbox Clarity data helps validate UX changes, onboarding effectiveness, and training impact before rolling changes into production—reducing risk and support tickets.