Azure Application Insights - Javascript 中具有自定义属性的 trackEvent

Azure Application Insights - trackEvent with custom properties in Javascript

我们正在使用客户端 javascript SDK(通过 snippet-based integration) for Application Insights to track custom events

appInsights.trackEvent({name:"WinGame"});

如何向其中添加自定义属性?像这样的东西?!

appInsights.trackEvent({name:"WinGame", customProperties:{gameName:"Game 1", player:"my player 1"}});

JS Azure appinsights github page 上看到:

Custom properties can be included in your telemetry through the properties named argument. This can be done with any of the Track APIs.

appInsights.trackEvent({   
    name: 'some event',  
    properties: { // accepts any type
       prop1: 'string',
       prop2: 123.45,
       prop3: { nested: 'objects are okay too' }   
    } 
});