Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public trackPageView(pageView: PageViewTelemetry) {
const pageViewData = new appinsights.Contracts.PageViewData();
pageViewData.name = pageView.name;
pageViewData.ver = 1;
const data = new appinsights.Contracts.Data();
data.baseData = pageView;
data.baseType = "PageViewData";
const envelope = new appinsights.Contracts.Envelope();
envelope.data = data;
envelope.time = new Date().toISOString();
envelope.ver = 1;
envelope.iKey = this._client.config.instrumentationKey;
envelope.name = "Microsoft.ApplicationInsights.PageView";
envelope.tags = this._client.context.tags;
this._client.channel.send(envelope);
}
public trackPageView(pageView: PageViewTelemetry) {
const pageViewData = new appinsights.Contracts.PageViewData();
pageViewData.name = pageView.name;
pageViewData.ver = 1;
const data = new appinsights.Contracts.Data();
data.baseData = pageView;
data.baseType = "PageViewData";
const envelope = new appinsights.Contracts.Envelope();
envelope.data = data;
envelope.time = new Date().toISOString();
envelope.ver = 1;
envelope.iKey = this._client.config.instrumentationKey;
envelope.name = "Microsoft.ApplicationInsights.PageView";
envelope.tags = this._client.context.tags;
this._client.channel.send(envelope);
}