Skip to main content

Notifications

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:
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    5,970 Super User 2025 Season 1 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans