Search the Community
Showing results for tags 'page views'.
-
Hi Guys, I have seen some other threads that talk about this but nothing recent nor in line with what I need. I have basically created a page in which I am tracking the number of views. I update the counter which is tied to a field I added to the page's template that I am tracking. The field is hidden from the website admin and only used for this data. However, now I need to track it on a daily basis. I am thinking of keeping track of all time view total for 30 days and perhaps saving that and allowing the user to see the page views of last 7 days, each day as a number and then 30 days of data. This way if I want to build in reporting functionality I can. What I need help with adding a date to the page_views field but also, knowing how many page_views for today, yesterday, day before etc. Here is what I have so far and its working. Now I need to associate a date with every day. NOT every update of the page_views field. if (!$user->hasRole('superuser')) { $page->page_views += 1; $page->of(false); $page->save('page_views'); $page->of(true); } echo $page->page_views; Any guidance, help, suggestions is absolutely appreciated. Thanks!!!!