Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Using Application Insights Telemetry in Views and Dashboards

Posted on by

Hi all,

Fairly new to Dynamics and I haven't been able to find a good answer for this yet.  I'm using Application Insights to fire telemetry for my product, and this is working fine in the Forms that I've attached the script to:

var appInsights=window.appInsights||function(a){
        function b(a){c[a]=function(){var b=arguments;c.queue.push(function(){c[a].apply(c,b)})}}var c={config:a},d=document,e=window;setTimeout(function(){var b=d.createElement("script");b.src=a.url||"az416426.vo.msecnd.net/.../ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie=d.cookie}catch(a){}c.queue=[];for(var f=["Event","Exception","Metric","PageView","Trace","Dependency"];f.length;)b("track"+f.pop());if(b("setAuthenticatedUserContext"),b("clearAuthenticatedUserContext"),b("startTrackEvent"),b("stopTrackEvent"),b("startTrackPage"),b("stopTrackPage"),b("flush"),!a.disableExceptionTracking){f="onerror",b("_"+f);var g=e[f];e[f]=function(a,b,d,e,h){var i=g&&g(a,b,d,e,h);return!0!==i&&c["_"+f](a,b,d,e,h),i}}return c
    }({
        instrumentationKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
    });
    
    window.appInsights=appInsights,appInsights.queue&&0===appInsights.queue.length&&appInsights.trackPageView();

However, I'd like to also track page views on my dashboards and views- some of which don't have any forms attached and therefore I won't see telemetry for.  Is there a way to fire Page Views for these?  Or to attach this Javascript to an OnLoad function or something similar?

Related: We're also looking to track page actions like clicks in the future, and AppInsights supports custom telemetry firing- but is there a way I can wire up that telemetry to any clicks within my D365 application?

Thanks so much for any help!

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Using Application Insights Telemetry in Views and Dashboards

    You can add a button in Application ribbon so that the button will display in all areas like Dashboard, Form, Views. Try to add Enable/display rule with custom script action, add the AppInsights js snippet in that script action. This way you got button in every single place, the script trigger all the time, can track the telemetry.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans