Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharePoint telemetry #1449

Open
2 of 9 tasks
abdjyg opened this issue Nov 5, 2024 · 0 comments
Open
2 of 9 tasks

SharePoint telemetry #1449

abdjyg opened this issue Nov 5, 2024 · 0 comments
Labels
sample: js-application-appinsights-advanced type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs

Comments

@abdjyg
Copy link

abdjyg commented Nov 5, 2024

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

  • Internet Explorer
  • Microsoft Edge
  • Google Chrome
  • FireFox
  • Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Node.js version

v16.20.0

Additional environment details

NA

@abdjyg abdjyg added Needs: Triage 🔍 type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sample: js-application-appinsights-advanced type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs
Projects
None yet
Development

No branches or pull requests

2 participants