text:
Q: Send custom complex properties to Telemetry to Azure Portal with App Insights TrackEvent in Javascript? How can I send custom complex non-string properties to Telemetry to Azure Portal with App Insights TrackEvent in basic Javascript (not NodeJS)?
I initialized the Application Insights JavaScript SDK through the following setup snippet:
<script type='text/javascript'>
        var appInsights=window.appInsights||function(config)
        {
            function r(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=u.createElement(o),i,f;for(s.src=config.url||'//az416426.vo.msecnd.net/scripts/a/ai.0.js',u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=['Event','Exception','Metric','PageView','Trace','Ajax'];i.length;)r('track'+i.pop());return r('setAuthenticatedUserContext'),r('clearAuthenticatedUserContext'),config.disableExceptionTracking||(i='onerror',r('_'+i),f=e[i],e[i]=function(config, r, u, e, o) { var s = f && f(config, r, u, e, o); return s !== !0 && t['_' + i](config, r, u, e, o),s}),t
        }({
            instrumentationKey: "@Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey"
        });
        window.appInsights=appInsights;
        appInsights.trackPageView();
    </script>

I tried the example from here https://github.com/microsoft/ApplicationInsights-JS and here https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics#properties but without success:
appInsights.trackEvent({
  name: 'EventName',
  properties: { // accepts any type
    prop1: 'string',
    prop2: 123.45,
    prop3: {
        nested: 'objects are okay too'
    }
  }
});

In the Ajax track request sent to Azure the sent payload has this form:
ver: 2
name:
   name: 'EventName'
      properties:
         prop1: 'string'
         prop2: 123.45
         prop3:
            nested: 'objects are okay too'

And in the Azure Portal App Insights, I get this:
CUSTOM EVENT
Event name  [object Object]

I also get an Javascript Warning in the Console:
Logging.ts:206 AI: CannotSerializeObjectNonSerializable
message:"Attempting to serialize an object which does not implement ISerializable"
props:"{name:name}"

I was able to send only by specifying name property separately and only string typed properties and only one-level nested properties.
Successful tests:
appInsights.trackEvent("EventName1", { properties: 'something' });
appInsights.trackEvent("EventName2", { prop1: 'something', prop2: 'prop2' });

Unsuccessful tests:
appInsights.trackEvent("EventName3", { prop1: 'prop1', nestedProp2: {prop2: 'prop2'} });
appInsights.trackEvent('EventName4', { properties: { dataToSend: 'something' }, measurements: {prop1: 'prop1', prop2: 'prop2'}});

A: The problem is with the SDK version.
In Azure portal and in tags property from browser AJAX calls it shows that i'm using the 1.0.21 SDK version, and those examples are for 2.5.3 SDK version, which are not backward compatible.
The solution was to upgrade to the latest SDK version by replacing the snippet setup (the main difference would be in changing url az416426.vo.msecnd.net/scripts/a/ai.0.js with this one az416426.vo.msecnd.net/scripts/b/ai.2.min.js).
The new Snippet Setup:
<script type="text/javascript">
var sdkInstance="appInsightsSDK";window[sdkInstance]="appInsights";var aiName=window[sdkInstance],aisdk=window[aiName]||function(n){var o={config:n,initialize:!0},t=document,e=window,i="script";setTimeout(function(){var e=t.createElement(i);e.src=n.url||"https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",t.getElementsByTagName(i)[0].parentNode.appendChild(e)});try{o.cookie=t.cookie}catch(e){}function a(n){o[n]=function(){var e=arguments;o.queue.push(function(){o[n].apply(o,e)})}}o.queue=[],o.version=2;for(var s=["Event","PageView","Exception","Trace","DependencyData","Metric","PageViewPerformance"];s.length;)a("track"+s.pop());var r="Track",c=r+"Page";a("start"+c),a("stop"+c);var u=r+"Event";if(a("start"+u),a("stop"+u),a("addTelemetryInitializer"),a("setAuthenticatedUserContext"),a("clearAuthenticatedUserContext"),a("flush"),o.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4},!(!0===n.disableExceptionTracking||n.extensionConfig&&n.extensionConfig.ApplicationInsightsAnalytics&&!0===n.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)){a("_"+(s="onerror"));var p=e[s];e[s]=function(e,n,t,i,a){var r=p&&p(e,n,t,i,a);return!0!==r&&o["_"+s]({message:e,url:n,lineNumber:t,columnNumber:i,error:a}),r},n.autoExceptionInstrumented=!0}return o}(
{
  instrumentationKey:"INSTRUMENTATION_KEY"
}
);(window[aiName]=aisdk).queue&&0===aisdk.queue.length&&aisdk.trackPageView({});
</script>

Now, the following Cutom Event is sent and received in Azure portal App Insights as expected:
appInsights.trackEvent({
  name: 'EventName',
  properties: { // accepts any type
    prop1: 'string',
    prop2: 123.45,
    prop3: {
        nested: 'objects are okay too'
    }
  }
});

A: Credit to @FlorinVîrdol for his great answer to this question! I would have added a reply comment but I had too much to write...
My requirement was to track the page view by authenticated user id, so in ASP.NET MVC in _Layout.cshtml, get the authenticated user id:
@{
    string authUserId = HttpContext.Current?.User?.Identity?.Name;
    if (string.IsNullOrEmpty(authUserId))
    {
        authUserId = "Not authenticated";
    }
}

I used this value in the same script snippet as @FlorinVîrdol, apart from (a) I needed to use the full app insights connection string which was in the web.config and (b) I wanted to set the user id directly in trackPageView rather than another call to trackEvent, so:
    <script type="text/javascript">
        var sdkInstance = "appInsightsSDK"; window[sdkInstance] = "appInsights"; var aiName = window[sdkInstance], aisdk = window[aiName] || function (n) { var o = { config: n, initialize: !0 }, t = document, e = window, i = "script"; setTimeout(function () { var e = t.createElement(i); e.src = n.url || "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js", t.getElementsByTagName(i)[0].parentNode.appendChild(e) }); try { o.cookie = t.cookie } catch (e) { } function a(n) { o[n] = function () { var e = arguments; o.queue.push(function () { o[n].apply(o, e) }) } } o.queue = [], o.version = 2; for (var s = ["Event", "PageView", "Exception", "Trace", "DependencyData", "Metric", "PageViewPerformance"]; s.length;)a("track" + s.pop()); var r = "Track", c = r + "Page"; a("start" + c), a("stop" + c); var u = r + "Event"; if (a("start" + u), a("stop" + u), a("addTelemetryInitializer"), a("setAuthenticatedUserContext"), a("clearAuthenticatedUserContext"), a("flush"), o.SeverityLevel = { Verbose: 0, Information: 1, Warning: 2, Error: 3, Critical: 4 }, !(!0 === n.disableExceptionTracking || n.extensionConfig && n.extensionConfig.ApplicationInsightsAnalytics && !0 === n.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)) { a("_" + (s = "onerror")); var p = e[s]; e[s] = function (e, n, t, i, a) { var r = p && p(e, n, t, i, a); return !0 !== r && o["_" + s]({ message: e, url: n, lineNumber: t, columnNumber: i, error: a }), r }, n.autoExceptionInstrumented = !0 } return o }({
            connectionString: "@ConfigurationManager.AppSettings["AppInsightsConnectionString"]"
        });
        (window[aiName] = aisdk).queue && 0 === aisdk.queue.length && aisdk.trackPageView({
            properties: {
                AuthId: '@authUserId.Replace(@"\", @"\\")'
            }
        });
    </script>

In Azure you can then perform the following query in the Logs section to see the users page views:
pageViews
    | where timestamp > datetime("2022-06-10T00:00:00.000Z")
        and timestamp < datetime("2022-06-11T00:00:00.000Z")
    | where client_Type == "Browser"
    | where customDimensions.AuthId == "UK\\someuser"
    | extend authId = customDimensions.AuthId
    | sort by timestamp asc

For reference the minified JavaScript trackPageView method in az416426.vo.msecnd.net/scripts/b/ai.2.min.js looks like this if you need to set more params which you can do by name as I have done above:
trackPageView=function(e,n,t,r,i){this.appInsightsNew.trackPageView({name:e,uri:n,properties:t,measurements:r})


TUESDAY, Feb. 28 (HealthDay News) -- Teenagers who suffer a concussion are more sensitive than adults or children to its aftereffects, Canadian researchers report.
Concussions can affect short-term memory in adolescents, which is essential for reading and calculating, and those effects can last for six months or longer, the study authors found.
"It's not that surprising," Ellemberg noted. "We know the adolescent's brain, more specifically the areas affected by the concussion, the frontal lobe areas of the brain, are growing in spurts and when something is developing rapidly it is even more fragile to injury."
The report was published Feb. 28 in the journal Brain Injury.
To come to its conclusions, Ellemberg's team worked with 96 male athletes who had suffered a concussion three to nine months before testing. The athletes were divided into three groups: adults (30), kids aged 9 to 12 (32) and teens aged 13 to 16 (34). These athletes were then compared with similar people who had not had a concussion.
All of the study participants were given neuropsychological tests used by the U.S. National Hockey League. The researchers then compared the results of those tests with the results of electrophysical evaluations that measured working memory, attention and inhibition while participants worked on a computer. Electrophysical tests are considered more sensitive than neuropsychological screens, the study authors noted.
The researchers found all the athletes who suffered concussions had results on their electrophysical evaluations that indicated injurious effects, compared with similar people who had not had a concussion.
Among teens, there were also problems with short-term working memory that lasted six months to a year, they noted.
"We find that most concussions are similarly severe, whether or not there is loss of consciousness," Ellemberg said.
Immediate symptoms after an injury are not a way to know how a child is doing, he said. "You, typically, have to wait for a couple of days, or even weeks, after the injury to see the symptoms," Ellemberg explained. "Concussions are severe, and do have consequences. We need to have a systematic system to evaluate these children."
After a suspected concussion, the child or teen should be seen by a medical professional who can assess the patient and make a plan for when the child can go back to playing, he said.
"We can't be afraid to have our kids play sports. We know that it's good for the child's physical health and mental health," Ellemberg stressed. "So, we want to encourage sports, but we want to make sure that we do it in a safe way."
Commenting on the study, Gillian Hotz, director of the concussion program at the University of Miami Miller School of Medicine, said that "kids have developing brains, so issues may not show up until a year later when they are stressed to do more frontal lobe activities."
Concussions are preventable, she said, and there needs to be education about concussion directed to parents, coaches and children. "Of course, wearing helmets properly is important," Hotz noted, adding that more communities are taking a proactive approach to dealing with concussions.
For example, high school athletes in Miami are given tests of mental functioning before they can play. These give professionals a baseline with which to compare their symptoms after a concussion to see if there are changes, she explained.
These and other measure can make a difference in identifying and treating concussions, Hotz said.


text:
Market research, data, reports, marketing insights and analytics, forecasts and intelligence covering a range of technology industries. Also consumers surveys, custom consulting and events.
Content & Entertainment
Enterprise & Professional AV
Professional Broadcast
Futuresource ISTE 2019 Show Review
This year's ISTE conference and expo, exploring the latest developments in education technology, attracted more than 20,000 attendees in June. Futuresource Consulting's EdTech research analysts were there to explore and report on the key innovations, topics and trends.
From robots and esports to interactive displays and security, Futuresource expert insights are now available in a free 29-page show report, ready for download from the Futuresource website. With 550 exhibitors, thousands of products and more than 20,000 attendees, here's a preview of some of the information that can be found in the report.
A Change of Direction
ISTE 2019 revealed a shift in focus from its previous role as an information source for IT decision makers, towards a teacher conference, exploring the practical aspects of using technology in the classroom. This resulted in an increase in floor space dedicated to freemium apps, classroom tools and professional development solutions, as well as reducing the show's value for hardware, software and content exhibitors. Some notable brands missing from the exhibitor list included McGraw Hill, Dell, HP, Lenovo and BlackBoard. However, the vacuum was filled by an influx of universities, promoting degrees and other qualifications for teachers.
Platform Rivalries
Despite some companies choosing not to exhibit, Microsoft and Google both occupied substantial floor space. With the US education PC market entering its first major replacement cycle, both vendors made announcements concerning their education productivity suites and associated tools. Microsoft placed emphasis on accessibility within its core platforms, and new features for both Microsoft Teams for Education and Flipgrid. Google's key announcements included the launch of its new App Hub and updates to its quizzing and gradebook solutions.
Esports Makes an Appearance
Acer was the only major international PC hardware manufacturer exhibiting at the show, with esports the main focus of its stand. Esports has been on the fringe of gaming culture since the late 1990s, but its popularity has skyrocketed in recent years, attracting a growing audience to the world of competitive gaming. A recent Futuresource survey revealed that 70% of large universities in the US are already hosting esports activities, with over 140 universities offering scholarships for esports competitors, on similar terms to those seen for football, basketball and other sports. Futuresource expects that esports will begin to cascade down into the K-12 sector, and this was echoed by demonstrations on the Microsoft and Best Buy booths, as well as a range of conference sessions promoting the educational opportunities offered by esports.
Robots Everywhere
The ISTE website listed over 75 suppliers offering robotics solutions, and the show featured a plethora of dancing humanoids, maker kits and processor boards. However, the deployment of robotics kits at scale across US districts continues to present a challenge. As a result, the leading suppliers are focused on developing ties to the curriculum and the promotion of early adopter programs to drive awareness and customer buy-in.
Alexa Returns Despite Amazon's Privacy Concerns
Last year's ISTE show included Alexa skills announcements from software suppliers like PowerSchool and Frontline Education that would provide users with easy access to information and updates on key metrics. This year, the focus has moved to Alexa skills for learning. Testing organisation ACT announced a new skill that would help students prepare for upcoming tests, while Kahoot showcased a skill allowing students to answer quiz questions verbally. However, the role of voice assistants in classrooms remains unclear, as Amazon has publicly stated that Alexa should not be used in classrooms due to privacy concerns.
Security and Management Software Gaining Ground
Solutions for mobile device management, student safeguarding and curriculum management were showcased across ISTE by specialist vendors, LMS and SIS providers, distributors and system integrators. The focus was not only on improving learning for students, but also on reducing the administrative burden for teachers, especially through classroom management features and digital assessment tools. A major focus this year was on web filtering and access management, to ensure students can only access safe and appropriate web content in the classroom. However, most vendors still struggle to subdivide content on major websites such as YouTube, leading to these popular sites having to be blocked altogether for classroom use.
Interactive Display Market Continues its Ascendance
There were 24 interactive flat panel display (IFPD) brands on display this year, up from last year, with all vendors reporting increased activity. Industry opinion suggests that recommendations and demand from schools continues to influence district purchasing decisions, ensuring ISTE remains a key event in the IFPD industry calendar, despite the focus shift. There was a strong feeling of optimism and expectations for a successful next 12 months, with the replacement market providing substantial opportunities, as many of the early IWBs are now over 11 years old.
For a more detailed picture of all the news from this year's ISTE show, download your free copy of the Futuresource show report, available here>>
Date Published: 11 Jul 2019
Simon Bryant
Simon became Director of Research in October 2017. Since joining the company in 2000 Simon has worked across imaging, data storage, entertainment, and most recently he headed up the company's activities in Consumers Electronics.
Simon manages the company's continuous work in all aspects of CE, Entertainment, Imaging, Professional Displays and Education, with a focus TV displays, home AV, mobile, automotive and data-storage. In addition to managing the suite of continuous services, Simon is also a major contributor to various private client assignments.
Simon holds a Bachelors of Business Administration in Business Management from Lancaster University.
Latest Education Technology Insights
Administrative Tools are the New K-12 EdTech Battleground
As the number of electronic devices in use across North American schools continues to proliferate, K-12 curriculum leaders and IT decision makers are turning to administrative tools to manage data assets, track progress and provide support...
Author: Chris Pennell
Hybrid Learning: A Key Investment for Universities in Response to COVID-19
Make no mistake: COVID-19 has caused incredible disruption to higher education. As campus living is stripped from the usual buzz of freshers' week, students are understandably concerned about how university is set to become a not-so-memorable experience.
Author: Michael Boreham
Esports Education Investments Endure and Grow Amidst Budget Restrictions
Throughout 2020, esports has been one of the most notable champions amidst stay-at-home orders and social distancing policies.
Author: Chris Bull
Esports in Education Helping Children to Overcome Lockdown Isolation
Student engagement is the single most important cornerstone of any education solution. This importance has been proven throughout the practice of distance learning where globally, teachers have had to seek out new ways of engagement through purely digital rather than physical mechanisms. This has expressed itself in various forms throughout the world: the hybrid approach of Egypt utilising part time in-person
Futuresource Consulting LTD
2nd Floor, 4 Beaconsfield Road
St Albans, AL1 3RD
Hertfordshire, United Kingdom
Email. info@futuresource-hq.com
© 2021 Futuresource Consulting Ltd. All rights reserved. Company Registration No. 2293034

redpajama_set_name: RedPajamaCommonCrawl