web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

MS Clarity in Dynamics 365 Model Driven Apps (MDAs) for usability data

(4) ShareShare
ReportReport
Posted on by 8

I'm trying to tailor MDAs (views, records, layouts etc) for our end users, and it would be immensely useful to have usability data that is provided by Microsoft Clarity to support this. Has anyone been able to implement MS clarity successfully in Dynamics MDAs, and if so, how were you able to do it, what are the limitations?

Categories:
I have the same question (0)
  • Suggested answer
    Asif Rehmani (MVP) Profile Picture
    27 User Group Leader on at
    MS Clarity in Dynamics 365 Model Driven Apps (MDAs) for usability data
    Daivat provided the right detailed answer for if you want to do this yourself manually.
     
    Having said that, many many companies that we have talked to now do not want to go through all the struggle to implement Microsoft Clarity on Dynamics themselves. It is far too complicated than it needs to be unfortunately.
     
    So our company (VisualSP) has partnered with the Microsoft Clarity team to come up with a very simple solution for deploying Microsoft Clarity on Dynamics 365. We are listed on the official Clarity integrations page as well. Check it out if you want to consider going this route:
     
     
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,827 Super User 2025 Season 2 on at
    MS Clarity in Dynamics 365 Model Driven Apps (MDAs) for usability data
    Hello LC-28031625-0,
     

    You're aiming for a powerful combination: leveraging Microsoft Clarity's usability insights within Dynamics 365 Model-Driven Apps (MDAs). While it's not a straightforward, out-of-the-box integration, it is achievable with some workarounds.

    Understanding the Challenge:

    • Clarity's Script Injection: Microsoft Clarity primarily relies on injecting a JavaScript tracking script into the HTML of a web page.
    • MDA's Structure: Dynamics 365 MDAs are built on a framework that restricts direct HTML manipulation.

    •  

    Implementation Approaches:

    1. HTML Web Resources (Limited Scope):

      • Concept:

        • Create HTML web resources that embed your Clarity tracking script.
        • Embed these web resources within dashboards or forms where you want to track user behavior. 

      • Steps:

        1. Get Clarity Tracking Code: Obtain your Clarity tracking code from the Clarity project settings.
        2. Create HTML Web Resource: In Dynamics 365, create an HTML web resource.
        3. Embed Clarity Script: Paste the Clarity tracking code into the HTML of the web resource.
        4. Add to Forms/Dashboards: Add the HTML web resource to the forms or dashboards you want to track. 

      • Limitations:

        • This approach only tracks user behavior within the specific forms or dashboards where the web resource is embedded.
        • It doesn't provide comprehensive tracking across the entire MDA.
        • If the user navigates away from the form or dashboard that has the html web resource, then the tracking is lost. 

      • Use Cases:

        • Tracking user interactions on specific key forms.
        • Analyzing user behavior on dashboards.

        •  

    2. PCF Controls (Power Apps Component Framework) (More Robust):

      • Concept:

        • Develop a custom PCF control that injects the Clarity tracking script.
        • PCF controls have more flexibility in manipulating the DOM and handling JavaScript.
        • This allows the PCF control to be placed on the main form, and potentially loaded on all forms. 

      • Steps:

        1. Develop PCF Control: Create a PCF control that includes the Clarity tracking script.
        2. Add Control to Forms: Add the PCF control to the main form of the entities you want to track.
        3. Deployment: Deploy the PCF control to your Dynamics 365 environment. 

      • Advantages:

        • Potentially more comprehensive tracking across forms.
        • Improved control over script injection. 

      • Limitations:

        • Requires PCF development skills.
        • Potential performance impact.
        • Will require on going maintainance.

        •  

    3. Browser Extensions (User-Side):

      • Concept:

        • Develop a browser extension that injects the Clarity tracking script into all Dynamics 365 pages. 

      • Limitations:

        • Only tracks users who have installed the extension.
        • Not a reliable solution for comprehensive data collection.
        • Security concerns. 

      • Use Cases:

        • Tracking the behavior of a small group of users for testing purposes.

        •  
          

    4.  

    Key Considerations and Limitations:

    • Performance: Injecting JavaScript can impact the performance of your MDA. Test thoroughly to ensure minimal impact.
    • Security: Be mindful of security implications when injecting external scripts.
    • Maintenance: Any custom solutions will require ongoing maintenance.
    • Data Privacy: Ensure compliance with data privacy regulations.
    • Microsoft Support: Microsoft Support may not provide assistance with custom Clarity integrations.
    • Iframe Limitations: If you are using iframes within your forms, then the clarity code will need to be added to the contents of the Iframe as well.

    •  

    Recommendations:

    • PCF Controls (Preferred): If you have PCF development skills, this approach offers the most flexibility and potential for comprehensive tracking.
    • HTML Web Resources (For Specific Cases): Use HTML web resources for targeted tracking on specific forms or dashboards.
    • Prioritize Key Forms: Focus on tracking user behavior on the most critical forms and dashboards.
    • Test Thoroughly: Thoroughly test your implementation in a non-production environment.

    •  

    By using these approaches, you can effectively gather usability data from Microsoft Clarity within your Dynamics 365 MDAs.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Mansi Soni Profile Picture

Mansi Soni 243 Super User 2025 Season 2

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 158 Most Valuable Professional

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 95 Super User 2025 Season 2

Product updates

Dynamics 365 release plans