The author should not be included in the number of times a piece of content has been viewed. In general I think people are much more interested in counting the number of times someone other than the author has viewed the content. For example, this is how flickr counts photo views and it's quite handy to not inflate your view counts by looking at your own pictures.

Comments

ChrisKennedy’s picture

Status: Active » Needs review
StatusFileSize
new1.66 KB

And here's a simple patch.

ChrisKennedy’s picture

Still applies.

profix898’s picture

Status: Needs review » Reviewed & tested by the community

Makes totally sense to me. Patch applies and works as advertised. I think this is RTBC.

yched’s picture

+1 from me too - shouldn't we also exclude user 1 ?

ChrisKennedy’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.68 KB

Probably so - here's an update to exclude user 1 too.

ChrisKennedy’s picture

StatusFileSize
new1.68 KB

Sorry - here's the right patch.

profix898’s picture

What is special about user 1 in this context? The 'superuser' looking at content of user X is not different from user Y looking at user X's content IMO.
1. If the motivation for this issue is to not count authors of a node (for example to prevent abuse of the node counter for ranking purposes) then there is no reason to handle user 1 differently.
2. If the argument to exclude user 1 is that he/she moderates other users content, this also applies to other users with 'administer nodes' privileges.
All in all I dont see why user 1 should be handled special in this case ...

yched’s picture

@profix88 : I strongly disagree. user 1 is special. It's the one who sets up the site, and later modifies / updates / debugs it. These activities can mean browsing through the site and seeing some content over and over again, and this messes up statistics.

If the same person also happens to have 'regular' activities, they should happen under another identity, whose rights fall under regular per role access rights. I think it is explicitly advised, er, somewhere : 'do not use admin account for regular site activities'.

profix898’s picture

Status: Needs review » Reviewed & tested by the community

Patch still applies. Lets mark this RTBC again.

Steven’s picture

Status: Reviewed & tested by the community » Needs work

If the goal is to not count admin views, then an appropriate permission should be used rather than a uid check. "administer nodes" is a good candidate.

ChrisKennedy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.68 KB

Sounds fine to me - updated patch to check "administer nodes" permission rather than UID=1.

ChrisKennedy’s picture

StatusFileSize
new1.7 KB

Correct patch.

profix898’s picture

Of course, I agree (see comment 2. in #7). But I will leave for others to review before RTBC this time, although its still an easy patch. I feel demand for some more opinions ... ;)

Zothos’s picture

some minor cleanup

> db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES (%d, 1, 1, %d)', arg(1), time());
should be
> db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES (%d, %d, %d %d)', arg(1), 1, 1, time());

correct me if im wrong. Still learning the drupal coding way :P

ChrisKennedy’s picture

Nope, unnecessary until the Oracle db compatibility layer is added, which isn't getting into Drupal 6.

gábor hojtsy’s picture

While I strongly agree that excluding the author from the counter is a good idea, I am not so sure about excluding admins, but can see the reason behind it. Anyway, this needs to be documented on the stats module help pages (ie. standalone help page) and page helps (ie. help text on other pages like the stats overview pages), because it might not be intuitive.

catch’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs review » Needs work

marking to needs work for the help text and bumping to D7.

dave reid’s picture

It should probably make more sense to implement #90468: Only record unique hits in node counter stats, so the author's view only counts toward one view and doesn't increment the counter like crazy (the current implementation).

dave reid’s picture

Status: Needs work » Closed (won't fix)

I think it's probably safe to say this is "wont-fix" since it hasn't been touched in over a year.

ChrisKennedy’s picture

Status: Closed (won't fix) » Needs work

Issues can be old - that doesn't mean their status is different.

dave reid’s picture

Fair enough!

docbishop’s picture

It seems evident to me from reading the comments that different individuals might want to be able to determine just what is and is not included in the stats. One feels strongly that admins should count. One feels strongly they shouldn't. Some think only views by unique users should tick the counter. So, give the power to the individual to decide whether or not to count admin views, author views, etc. (in the gui).
It means more work, but allows choices to be made by site admins. I think this would provide a much more satisfactory solution in the end.

Anonymous’s picture

Status: Needs work » Closed (won't fix)

Ok, but 3.5 years later, I think we can all really agree that this is a won't fix.