SharePoint telemetry #1449
Labels
sample: js-application-appinsights-advanced
type:bug-suspected
Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs
Sample
https://github.com/pnp/sp-dev-fx-extensions/tree/main/samples/js-application-appinsights-advanced
Author(s)
@sudharsank
What happened?
I have deployed this extension in multiple sharepoint sites to track the pageviews and click events. In order to track pageviews in both web and through viva connections, I have enabled the property: enableAutoRouteTracking: true in my extension. Also I'm using click plugin instead of reactplugin.
The problem I'm facing is, if the pages are loaded in the same tab, the customprops is showing empty in the pageviews table. Could you please let me know the reason for it. If I access the pages in a different tab, these properties are captured properly.
const appInsights = new ApplicationInsights({
config: {
connectionString: 'xxx',
disableFetchTracking: true,
disableAjaxTracking: true,
autoTrackPageVisitTime: true,
enableAutoRouteTracking: true,
extensions: [clickPluginInstance],
extensionConfig: {
[clickPluginInstance.identifier]: clickPluginConfig}
});
appInsights.trackPageView({
name: document.title, uri: decodeURIComponent(window.location.href),
properties: {
["CustomPageProps"]: {
WebAbsUrl: decodeURIComponent(this.context.pageContext.web.absoluteUrl),
WebSerUrl: decodeURIComponent(this.context.pageContext.web.serverRelativeUrl),
WebId: this.context.pageContext.web.id,
UserTitle: this.context.pageContext.user.displayName,
UserEmail: this.context.pageContext.user.email,
UserLoginName: this.context.pageContext.user.loginName,
ScreenResolution: screen.width+"x"+screen.height
}
}
});
Steps to reproduce
I have deployed this extension in multiple sharepoint sites to track the pageviews and click events. In order to track pageviews in both web and through viva connections, I have enabled the property: enableAutoRouteTracking: true in my extension. Also I'm using click plugin instead of reactplugin.
The problem I'm facing is, when a user quickly navigate between different sharepoint pages, the custompageprops are showing empty in the pageviews table. Could you please let me know the reason for it. I set a timeout of 1 second for trackpageviews() but didn't make any change.
const appInsights = new ApplicationInsights({
config: {
connectionString: 'xxx',
disableFetchTracking: true,
disableAjaxTracking: true,
autoTrackPageVisitTime: true,
enableAutoRouteTracking: true,
extensions: [clickPluginInstance],
extensionConfig: {
[clickPluginInstance.identifier]: clickPluginConfig}
});
appInsights.trackPageView({
name: document.title, uri: decodeURIComponent(window.location.href),
properties: {
["CustomPageProps"]: {
WebAbsUrl: decodeURIComponent(this.context.pageContext.web.absoluteUrl),
WebSerUrl: decodeURIComponent(this.context.pageContext.web.serverRelativeUrl),
WebId: this.context.pageContext.web.id,
UserTitle: this.context.pageContext.user.displayName,
UserEmail: this.context.pageContext.user.email,
UserLoginName: this.context.pageContext.user.loginName,
ScreenResolution: screen.width+"x"+screen.height
}
}
});
Expected behavior
When you quickly navigate between sharepoint pages, the customprops will show empty in the pageviews table.
Target SharePoint environment
SharePoint Online
Developer environment
None
Browsers
Node.js version
v16.20.0
Additional environment details
NA
The text was updated successfully, but these errors were encountered: