1

I want a report that displays how many times a list item has been viewed. I tried to obtain this information from Audit Log Reports but the exported Excel file does not appear to give this information. The columns available are: Site Id, Item Id, Item Type ... Under Item ID I have a list of GUIDs with either a Document or List Item Type. I can see several different List ones.

I know a list item has an ID but does it also have an actual GUID? How can I find what the GUID is of the item so I can cross reference to the report?

Users access the list item by:

http://sharesite/SitePages/NewsDialog.aspx?IDA=21&IsDlg=1

UPDATE: output of Rest (removed body tag to save space)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://share.lifecapnet.com/_vti_bin/listdata.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:etag="W/&quot;8&quot;" xmlns="http://www.w3.org/2005/Atom">
  <id>http://share.lifecapnet.com/_vti_bin/listdata.svc/StrategicNews(21)</id>
  <title type="text">New Life Capital team making connections at first offsite</title>
  <updated>2016-02-04T12:15:36Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="StrategicNewsItem" href="StrategicNews(21)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/TextPosition" type="application/atom+xml;type=entry" title="TextPosition" href="StrategicNews(21)/TextPosition" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/BngImage" type="application/atom+xml;type=entry" title="BngImage" href="StrategicNews(21)/BngImage" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="StrategicNews(21)/CreatedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="StrategicNews(21)/ModifiedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="StrategicNews(21)/Attachments" />
  <category term="Microsoft.SharePoint.DataService.StrategicNewsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>
      <d:ContentTypeID>0x01009E2B3766E4C83B4BB6BBF56C1751719A</d:ContentTypeID>
      <d:Title>New Life Capital team making connections at first offsite</d:Title>
      <d:ApproverComments m:null="true" />
      <d:Intro>Video now available</d:Intro>

      <d:NewsRelease m:type="Edm.DateTime">2016-01-22T00:00:00</d:NewsRelease>
      <d:NewsExpire m:type="Edm.DateTime">2016-02-12T00:00:00</d:NewsExpire>
      <d:TextPositionValue>Bottom</d:TextPositionValue>
      <d:BngImageId m:type="Edm.Int32">52</d:BngImageId>
      <d:ApprovalStatus>0</d:ApprovalStatus>
      <d:Id m:type="Edm.Int32">21</d:Id>
      <d:ContentType>Item</d:ContentType>
      <d:Modified m:type="Edm.DateTime">2016-02-04T12:15:36</d:Modified>
      <d:Created m:type="Edm.DateTime">2016-01-22T09:58:39</d:Created>
      <d:CreatedById m:type="Edm.Int32">184</d:CreatedById>
      <d:ModifiedById m:type="Edm.Int32">184</d:ModifiedById>
      <d:Owshiddenversion m:type="Edm.Int32">8</d:Owshiddenversion>
      <d:Version>2.0</d:Version>
      <d:Path>/Lists/StrategicNews</d:Path>
    </m:properties>
  </content>
</entry>

1 Answer 1

3

Yes, a list item has both an ID (integer: 1, 2, 3...) and a UniqueId (a GUID).
You can get the UniqueId of a given item you know the ID of with PowerShell:

$web = Get-SPWeb http://<URL>
$list = $web.Lists["<ListName>"]
$item = $list.GetItemById(<Integer_ID>)
$item.UniqueId

You can get the same all client-side by requesting the REST API:

Client-side (SP2013):

http://sharesite/_api/lists/getbytitle('Site pages')/items/getbyid(21)?$select=UniqueId

Client-side (SP2010), for document libraries:
Get the m:etag value from:

http://sharesite/_vti_bin/listdata.svc/Sitepages(21)

Client-side (SP2010), for lists:
Use the following JavaScript. You can simply copy/paste it in the address bar of Internet Explorer (mind the javascript prefix that me be dropped when you paste it) (and be sure to first navigate to a page of the target site):

javascript:var ctx = SP.ClientContext.get_current(); var item = ctx.get_web().get_lists().getByTitle('Strategic News').getItemById(21);ctx.load(item);ctx.executeQueryAsync(function(){alert(item.get_item('UniqueId'));},null);

EDIT
OK, now that we've found all that, as per your comments, it looks like getting the UniqueId of the item was not what you needed to get view reports.
To get what you want (i.e. views of a given page with a given query string param), the best would be to parse IIS logs. IIS logs contain all information (datetime, client IP, authentified user if any, page URL, request string...) you need here. Just remind they reside on all servers of the farm, so you'll have to get them from all servers to have a complete report. Here are some toools to parse IIS logs:

14
  • I don't have access to powershell, any other options? Commented Feb 8, 2016 at 12:36
  • Edited my answer to add client-side options.
    – Evariste
    Commented Feb 8, 2016 at 12:39
  • I've typed in the SP2010 version and I get the xml for the list item but cant see the guid for the item in xml. Does it work for you? Commented Feb 8, 2016 at 13:03
  • Yes, it does. Don't you find the <link m:etag node in the XML file? As I mentioned, it's the one containing the UniqueId for the item.
    – Evariste
    Commented Feb 8, 2016 at 13:10
  • Updated question with REST output, could you kindly look. thanks Commented Feb 8, 2016 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.