function captureTelemetryForportal(eventName) {
                var url = window.location.host;
                var Enviornment = url; // Returns URL

                var appInsights = window.appInsights;
                if(window.appInsights.config.instrumentationKey==null ||window.appInsights.config.instrumentationKey==null=="" )
                    appInsights=   function (config) {
                    function s(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, r = document, f = window, e = "script", o = r.createElement(e), i, u; for (o.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", r.getElementsByTagName(e)[0].parentNode.appendChild(o), t.cookie = r.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) s("track" + i.pop()); return config.disableExceptionTracking || (i = "onerror", s("_" + i), u = f[i], f[i] = function (config, r, f, e, o) { var s = u && u(config, r, f, e, o); return s !== !0 && t["_" + i](config, r, f, e, o), s }), t
                }({
                    instrumentationKey:"26209377-fd7c-42a6-96c7-10b36848fa65"
                });

                window.appInsights = appInsights;

                //OneITTelemetry extensions code.

                var extensions = new Telemetry.Extensions.AI.AppInsights();
                var environmentData = new Telemetry.Extensions.AI.EnvironmentValues(Enviornment, "Shared Platforms", "CRM and ERP", "Connected Crm", "Analog Support - Havok Portal ", "ConnectedCRMWeb");

                appInsights.queue.push(function () {
                    extensions.AddMsitTelemetryInitializers(appInsights, environmentData, null);
                });
                //End of OneITTelemetry extensions code.

                var userName = $('.username').html();   // captures logged In user Name
                var pathname = window.location.pathname;
                var PageName = pathname.slice(1, -1);
                PageNameandMethod = PageName + " " + eventName;  // Captures Page Name and Method

                appInsights.trackPageView(PageNameandMethod, window.location.href, { User: userName, DomainName: "Domain" });

            }