Skip to main content

Project Server Help Blog

Go Search
Project Server Help Blog
Project Server Experts Community
MSProjectExperts
Training Schedule
Contact Us
  

Project Server Help Blog > Posts > Monitor Your Project Server Investment by Measuring Project Web Access Traffic and Usage
 

 MS Project and Project Server Resources

 
Monitor Your Project Server Investment by Measuring Project Web Access Traffic and Usage

When it comes to implementing Project Server, many would agree that installing and configuring the tool is the easy part; the hard part comes when you try to 'motivate' everyone in the organization to use the system properly and consistently. Although forcing some people to log their task progress or view the online reports that you spent hours building can be an exercise in futility, at least we can monitor usage patterns to get some insight into who IS using the system and which features or reports / views they are using on a regular basis.

This technique is for PWA only and will not allow you to see Project Professional usage, and it will not allow you to see ALL areas of PWA that people are accessing. Although this technique is limited to monitoring usage of any PWA web part page that is editable via the web browser, it does not require any direct server-level access to implement. Here's how it works:

  • Create a somewhat hidden custom SharePoint list ('traffic log') within the PWA web site to track page visits.
  • Switch one or more PWA pages into edit mode and drop some javascript into a Content Editor Web Part (CEWP); the javascript will grab the page's address whenever the page is visited and create a new entry in the 'traffic log' list.

That's it... nothing to it! Let's get started...

 

Create the Traffic Log

1. Visit PWA and select Site Actions > Create:

 

2. On the Create page, select Custom List:

 

3. On the New page, enter a Name for the list (such as trafficlog), select No for Display this list on the Quick Launch, then click the Create button:

 

4. On the trafficlog page, select Settings > List Settings:

 

5. On the Customize trafficlog page, in the Columns section, select the Title column:

 

6. On the Change Column page, change the Column name to page, then click the OK button:

 

7. On the Customize trafficlog page, scroll down to the Views section and click the All Items view:

 

8. On the Edit View page, select the Display check box next to the Created and Created By columns, then click the OK button:

 

Add Javascript to Pages for Tracking (Using PWA Home Page as Example)

1. Visit the desired PWA page (the PWA Home page, in this example) and select Site Actions > Edit Page:

 

2. With the page in edit mode, click the orange Add a Web Part bar that spans the entire width of the Header web part zone above the Reminders web part:

 

3. In the Add Web Parts to Header dialog, scroll down to the Miscellaneous section, select the Content Editor Web Part, then click the Add button:

 

4. With the CEWP on the page, open the edit menu (located in the upper right corner of the new web part) and select Modify Shared Web Part:

 

5. In the newly-opened Content Editor Web Part panel on the right side of the page, click the Source Editor... button:

 

6. In the Text Entry dialog box, paste the following javascript, then click the Save button:

 

//********** START COPY JAVASCRIPT BELOW THIS LINE **********

<script language="javascript">

function PostToTrafficLog()

{

var siteurl = "http://yourprojectserver/pwa";

var trafficlogname = "trafficlog";

try

{

wsURL = siteurl + "/_vti_bin/Lists.asmx";

//SOAP Action and XML

var wsSoapAction = "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems";

var wsXML = '<?xml version="1.0" encoding="utf-8"?>';

wsXML += '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';

wsXML += 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ';

wsXML += 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';

wsXML += '<soap:Body>';

wsXML += '<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">';

wsXML += '<listName>' + trafficlogname + '</listName>';

wsXML += '<updates>';

wsXML += '<Batch OnError="Continue" ListVersion="1">';

wsXML += '<Method ID="1" Cmd="New">';

wsXML += '<Field Name="ID">New</Field>';

wsXML += '<Field Name="Title">'+ window.location.href + '</Field>';

wsXML += '</Method>';

wsXML += '</Batch>';

wsXML += '</updates>';

wsXML += '</UpdateListItems>';

wsXML += '</soap:Body>';

wsXML += '</soap:Envelope>';

//Create XML Document and get HTTP response using XMLHTTP object

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

var httpResponse = getServiceResults(wsURL, wsSoapAction, wsXML);

}

catch(Exception)

{

// Suppress any excess script errors to avoid user confusion.

}

}

function getServiceResults(url, soap, xml) {

//Send XML packet to web service and return HTTP response text

try {

if (xml.length > 0) {

xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

xmlHttp.open("POST", url, false);

xmlHttp.setRequestHeader("SOAPAction", soap);

xmlHttp.setRequestHeader("Content-Type", "text/xml");

xmlHttp.send(xml);

if (parseInt(xmlHttp.status) == 404) {

return 404;

}

else {

return xmlHttp.responseText;

}

}

}

catch(e) {

alert(e.message);

}

}

PostToTrafficLog();

</script>

//********** END COPY JAVASCRIPT ABOVE THIS LINE **********

 

NOTE: You will need to change the following two values in the javascript, located on lines 4 and 5:

var siteurl = "http://yourprojectserver/pwa";

var trafficlogname = "trafficlog";

siteurl is the URL of your PWA site, and trafficlogname is the name of the custom traffic log list that you created previously. Update the values between the quotation marks to reflect your system.

 

7. In the Content Editor Web Part panel, expand the Appearance section, then enter a Title for the CEWP (such as Traffic Logger) and select None for Chrome Type (you may need to scroll the panel downward) and click the OK button:

 

8. Select Exit Edit Mode in the upper right corner of the page:

 

Repeat steps 1-8 in this section for every PWA page that you would like to monitor.

 

View the Traffic Log

If you chose to hide the trafficlog list from the Quick Launch menu, there is no direct way to access it; here is one option:

1. Click on the Documents heading in the PWA Quick Launch menu:

 

2. On the All Site Content page, click View All Site Content at the top of the Quick Launch menu:

 

3. On the All Site Content page, click trafficlog, located below the Lists heading:

 

Each time someone visits a PWA with the javascript tracking code, a new entry will be added to the trafficlog list:

 

Pages That Will Accept the Tracking Code Easily

Not all PWA pages are editable within the web browser; here are a few pages that are:

  • Home
  • My Work (tabbed Tasks, Timesheet, and Schedule page)
  • My Tasks
  • My Timesheet (not My Timesheets!)
  • Project Center
  • Resource Center
  • Resource Assignments
  • Data Analysis
  • Task Updates Approvals
  • Administrative Time Approvals
  • My Queued Jobs

 

Extra Credit

You may also notice that the Project Details page (ProjectDrillDown.aspx) is not editable out of the box; however, if you are careful and if you have direct access to the Project Server, you can make the page editable by using the information posted in Brian Smith's blog post here:

http://blogs.msdn.com/brismith/archive/2008/11/24/project-server-2007-where-did-my-web-part-go.aspx

If you DO choose to add the tracking code to the Project Details page, I would advise you to immediately remove the ability to edit the page after you are done.

Happy hacking!

Comments

PWA Usage

This is great stuff! Tony.
Thanks for sharing. I will test and send my feedback.

Thanks
Regards
PJ Mistry
at 10/18/2009 1:49 PM

PWA Page Tracking

Brilliant !   BY sheer coincidence this is very close to something one of our customers just asked for - so this is very opportune !  Many Thanks Tony.
at 10/20/2009 6:03 PM

Pages that can be tracked in PWA

Nice idea Tony.  Very close to auditing which was only included for the timesheet usage.  I bet this will make you famous, at least for 15 minutes as the saying goes.

Anyhow, I just wanted to mention that the pages where this technique will work "easily" are WebPart pages.  Non of the WSS forms will support this method. :(

Thanks again Tony for sharing,

David Ducolon
AdaQuest, Inc.
at 10/27/2009 2:09 PM

Add Comment

Spam Test

Unfortunately, spammers have made our lives a bit more annoying.
Please help us take a bite out of spam.

Before submitting a comment, please prove that you are not a spam bot
by using the buttons to enter the number shown below:



          

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Commenter Name


Website URL

Type the Web address: (Click here to test)  

Type the description: 

Attachments