2017-06-10 1 views
0

エンドユーザのユーザ分析をアプリケーションの洞察力をDocFxに追加して、どのドキュメントページの使用状況を追跡するにはどうすればよいですか?Application Insightsエンドユーザのユーザ分析を使用したDOXFX

Application Insightのドキュメントでは、終了タグの直前にJavaScriptスニペットを挿入する必要があると書かれていますが、これがDocFxで可能かどうか、またはこれを実行する最良の方法がわかりません。

ポストプロセッサが必要ですか、カスタムテンプレートを使用できますか?

<!-- 
To collect end-user usage analytics about your application, 
insert the following script into each page you want to track. 
Place this code immediately before the closing </head> tag, 
and before any other scripts. Your first data will appear 
automatically in just a few seconds. 
--> 
<script type="text/javascript"> 
    var appInsights=window.appInsights||function(config){ 
    function i(config){t[config]=function(){var 
i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s="AuthenticatedUserContext",h="start",c="stop",l="Track",a=l+"Event",v=l+"Page",y=u.createElement(o),r,f;y.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(y);try{t.cookie=u.cookie}catch(p){}for(t.queue=[],t.version="1.0",r=["Event","Exception","Metric","PageView","Trace","Dependency"];r.length;)i("track"+r.pop());return i("set"+s),i("clear"+s),i(h+a),i(c+a),i(h+v),i(c+v),i("flush"),config.disableExceptionTracking||(r="onerror",i("_"+r),f=e[r],e[r]=function(config,i,u,e,o){var s=f&&f(config,i,u,e,o);return s!==!0&&t["_"+r](config,i,u,e,o),s}),t 
    }({ 
     instrumentationKey:"###-###-###-##" 
    }); 

    window.appInsights=appInsights; 
    appInsights.trackPageView(); 
</script> 

答えて

0

PostProcessorが必要ありません。これを実現するには、テンプレートをカスタマイズします。詳細はofficial tutorialまたはthis questionにあります。コードはpartials/head.tmpl.partialに追加できます。生成されたすべてのページに影響します。

+0

ありがとうございました!これを試してみましょう。 partials/head.tmpl.partialの使用を認識していなかった – Rob

関連する問題