Forum Discussion

ssandu's avatar
ssandu
Copper Contributor
Feb 13, 2021

SPFx Application customizer on each page

Hi,

 

I need to insert Application Insights javascript on every page on a site collection.

I've tried this sample https://github.com/pnp/sp-dev-fx-extensions/tree/master/samples/js-application-appinsights-advanced but seems to work only on page declared in serve.json

Any ideas what I am doing wrong ?

2 Replies

  • ssandu Did you deploy your SPFx extension solution to app catalog and added it to your site/site collection?

     

    It should work after deployment. Check how to Deploy your extension to SharePoint 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • ssandu's avatar
      ssandu
      Copper Contributor
      Hi,
      Yes I've uploaded to app catalog.
      I've added an alert to see what is happening.
      This is the issue:
      Browse to home page - alert = true
      Browse to a news page - alert = false
      Refresh the news page - alert = true
      Create a news page - alert = true (on createpage.aspx)
      Save the page - alert= false
      Refresh the page - alert = true.
      Since we need to track those pages with Application Insights I don't think it's a corect behavior.
      Thanks for reply

Resources