Instrumenting SharePoint

To inject the JavaScript into the pages of a Sharepoint site, do the following:

  1. First, add the Sharepoint site as a Real User Monitor component in eG.

    Figure 1 : Adding the Sharepoint site as a Real User Monitor component

  2. When adding the Real User Monitor component, you will be provided with the Javascript (as indicated by Figure 1 above) that you need to inject into the pages of your site.
  3. Copy this script to Notepad or any other Editor.
  4. Next, login to the Sharepoint site that you want to monitor as administrator.

    Figure 2 : The Home page of the Sharepoint site to be monitored

  5. Then, click on the Settings icon (indicated by Figure 3) at the right, top corner of the Home page to invoke a menu. From this menu, select the Site settings option.

    Figure 3 : Selecting the Site settings option from the Home page

  6. From the Site Settings window (see Figure 4) that then appears, select the Master Pages option in the Web Designer Galleries section.

    Figure 4 : Selecting the Master pages option

  7. When the Master Page Gallery opens (see Figure 5), look for the seattle.master file (in the case of Sharepoint 2013) or the v4.master file (in the case of Sharepoint 2010), in the gallery. Once you find it, hover your mouse over the file name in the gallery. A down-arrow icon (as indicated by Figure 5), will then become visible alongside. Click on the down-arrow icon.

    Figure 5 : Locating the seattle.master file on Sharepoint 2013

  8. Clicking on the down-arrow will invoke a menu. From this menu, select the Check Out option (see Figure 6).

    Figure 6 : Checking out the master file

  9. Then, select the Download a Copy option from the same menu (see Figure 7) to download a copy of the master file to any location on the local host.

    Figure 7 : Downloading a copy of the master file

  10. Next, open the downloaded copy of the master file in an Editor.
  11. Paste the Javascript code that you had copied to an Editor at step c of this procedure just above the </head> tag of the master file (as indicated by Figure 8).

    Figure 8 : Inserting the Javascript code in the master file

    Note:

    Make sure that the Javascript code snippet is copied to the master file with utmost diligence. Do not change any other content in the master file when copying the script, as it may lead to undesirable results.

  12. Save the file.
  13. Then, return to the Master Page Gallery of Figure 7. From the menu on top of the gallery, select the Files option. Pick the New menu from the Files menu, and then choose the Upload Document option from it to upload the modified master file.

    Figure 9 : Uploading the modified master file

  14. Figure 10 will then appear. Use the Choose File button in Figure 10 to select the master file to be uploaded. Provide appropriate comments in the Version Comments text box, and click the ok button.

    Figure 10 : Choosing the modified master file for uploading

  15. When Figure 11 appears, provide a Description and click the Save button therein.

    Figure 11 : Saving the changes to the master file

  16. Once back in the Master Page Gallery, make sure that the timestamp displayed against the master file reflects the time at which the file was modified (see Figure 12).

    Figure 12 : Confirming that the timestamp of the master file reflects the time of modification

  17. Now, go to Sharepoint’s Central Administration site, and select the Manage web applications option from the Application Management section of the site (see Figure 13).

    Figure 13 : Choosing to manage web applications

  18. When appears, select the Sharepoint web application into which you have injected the Javascript code snippet.

    Figure 14 : Selecting the Sharepoint web application to be monitored

  19. From the tool bar at the top of Figure 14, click on the General Settings tool and then pick the General Settings option from the menu that appears (see Figure 15).

    Figure 15 : Selecting the ‘General Settings’ option

  20. Once Figure 16 appears, scroll down the window until you see the Master Page Setting for Application _Layouts Pages section. In that section, check whether the Application _Layouts pages reference site master pages flag is set to Yes. If not, set it to Yes.

    Figure 16 : Setting the ‘Application –Layouts . . .’ flag to Yes

    Note:

    The illustrated example above takes the case of a web application on Sharepoint 2013 that is to be monitored by eG RUM. When RUM-enabling a web application on Sharepoint 2010, make sure you insert the script in the v4.master file. In other words, ensure that step 7 to step 16 of the procedure is performed on the v4.master file only, in the case of Sharepoint 2010.