I have contents of Blog document type and I would like to count user access times.
I'm using a property called View Count for the document type and increase 1 every time the template renders. The problem is I don't want the content to be published so I'm using Save (Content Service) and it makes the content status Published (spending changes) in umbraco backoffice.
It's not good I think. Is there any solution makes this better? Because I only want to know how many times the blog requested and don't make any change for the contents
if your site has google analytics, you can get much more information than just a count of the number of visits...
If not, and you only want the count of views, and you only want to manage it yourself - then you should avoid saving the count value on the doc type itself. This will create a version for every single save - if a an editor uses the rollback feature of Umbraco to go back to an earlier version of the blog post - they'll also rollback the current count!
It would be better to have a custom database table, that has columns for the pageId and the count, and then have an UmbracoApiController that could receive a request via javascript when the page is loaded, that then could update the database table with the increased count.
You could then build a custom 'Content App' (like the 'Visitors' one in that plugin) - with your own implementation called 'Counts' or something... and then you could query the database table, (as you'll be able to retrieve the current page Id in the backoffice in angularJS)...
Use a separate database table for storing view counts and update it on each page load. Avoid using the content service's save method instead increment view counts through server-side logic or API calls when a blog page is requested.
How to track content accessibility
Nice day guys.
I have contents of Blog document type and I would like to count user access times.
I'm using a property called View Count for the document type and increase 1 every time the template renders. The problem is I don't want the content to be published so I'm using Save (Content Service) and it makes the content status Published (spending changes) in umbraco backoffice.
It's not good I think. Is there any solution makes this better? Because I only want to know how many times the blog requested and don't make any change for the contents
I'm new with umbraco. Appreciate any help!
Hi Marcus
First thought would something like this plugin do the job?
https://marketplace.umbraco.com/package/flowcourier.umbraco.analytics
if your site has google analytics, you can get much more information than just a count of the number of visits...
If not, and you only want the count of views, and you only want to manage it yourself - then you should avoid saving the count value on the doc type itself. This will create a version for every single save - if a an editor uses the rollback feature of Umbraco to go back to an earlier version of the blog post - they'll also rollback the current count!
It would be better to have a custom database table, that has columns for the pageId and the count, and then have an UmbracoApiController that could receive a request via javascript when the page is loaded, that then could update the database table with the increased count.
You could then build a custom 'Content App' (like the 'Visitors' one in that plugin) - with your own implementation called 'Counts' or something... and then you could query the database table, (as you'll be able to retrieve the current page Id in the backoffice in angularJS)...
If that helps give you a steer?
regards
Marc
Use a separate database table for storing view counts and update it on each page load. Avoid using the content service's save method instead increment view counts through server-side logic or API calls when a blog page is requested.
Thank you all !
is working on a reply...