Showing number of times a listing has been viewed

9 posts by 6 authors in: Forums > CMS Builder
Last Post: December 7, 2010   (RSS)

Re: [willydoit] Showing number of times a listing has been viewed

By Jason - December 3, 2010

Hi,

There are a lot of different ways you can achieve this. For example, you can keep track of how many times a detail page by using an sql query to increment a field inside that record each time the page loads. It would be a little harder to do this for a listing page, because a listing page doesn't have a particular record.

I think the best way to do this would be to have a section that increments the number of hits based on it's url, that way you can track listings and detail pages in the same section.

We could create a plugin that would automatically increment the count each time the page loads. The plugin could have some simple php functions that you could call to get the count for that page. If you'd be interested in this, please send an email to consulting@interactivetools.com and we can go over what it would take to accomplish this.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Showing number of times a listing has been viewed

By Mikey - December 5, 2010

Jason... If you make it as an Add-On, I'd purchase it.

Re: [zick] Showing number of times a listing has been viewed

By Jason - December 6, 2010

Hi,

We don't have any current plans to develop this an an Add-on, but it could be done as a custom job. If send an email to consulting@interactivetools.com with a list of requirements for what you would need the add-on to be capable of, we can let give you an estimate on what it would cost.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [willydoit] Showing number of times a listing has been viewed

By gkornbluth - December 6, 2010 - edited: December 6, 2010

Hi Willydoit,

I've been using a simple PHP hit counter to count hits on my pages by incrementing a .txt file for quite a while.

Here's an excerpt from my CMSB Cookbook http://www.thecmsbcookbook.com that shows the code necessary.

CREATING A SIMPLE PHP HIT COUNTER


For each page that you want to count hits on, create a text document with the number that you want your counter to start with, and a unique file name, like: aboutpagecounter.txt and upload it to your site.

I usually insert the number 500 in my text files, so that my counters will not display a really small number at first, but you can start them with any number you want to.

If you have many separate counters, you might want to create a folder for your counter text files.

Then somewhere in the body of the page that you want to count, insert this code, changing the file name and path to suit your particular situation:

<?php
$count_my_page = ("aboutpagecounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);?>

Then, where you want your hit count to appear, insert this line of code:

_____ code <?php echo $hits[0]; ?>
You can, of course style your counter any way you want to.
___________________________________________

There's also a neat on line program I've used in the past called Crazy Egg. http://www.crazyegg.com/ It creates a heat map to track where visitors click on your pages.

Hope that helps,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Showing number of times a listing has been viewed

By Codee - December 6, 2010

Hey WillyDoIt,

One additional suggestion, if you have the membership plugin, is consider making the counter viewable only to you and your vendors and not the general public. The membership plugin allows certain contact to be viewable by certain logged in account holders and not to everyone (if you set it up that way). Just a thought.

Re: [equinox69] Showing number of times a listing has been viewed

By willydoit - December 7, 2010

Hi Thanks for that,

My main priority is to show how many times each clients detail page has been viewed and so need todifferentiate between each clients information being viewed, I assume your suggestion will just show how many times the details.php page has been loaded irrelevant of whos data it contained, can this be extended to create a hits log for each client?

Thanks in advance

Re: [willydoit] Showing number of times a listing has been viewed

By Codee - December 7, 2010

My answer is based upon me believing I am clearly understanding what you are asking... ;-)

To do this, what you would do is have each set of client's data pages under their account name as owner and/or creator...or make a separate field for "record user" or something and have it pull the user accounts field from the accounts section and you choose which user is attached to each set of records. By doing this, when they login, they will only see the records associated with their login.

For example, I have a client that is a teacher. She gives individualized lessons. Each of her students has an account in CMS that ONLY allows them to see the listings/detail pages for records that are linked to their user account. So when they login they only get the listings for their lessons and are able to click on the details pages for each of only their lessons. None of the students know about the CMSB backend...the login page takes them directly to the lessons listings page after user/pass are submitted. [If you have the membership plugin you'll see there is a separate login page template included with the plugin (that's modifiable) so you don't have to hand out the admin URL for CMSB at all.]

Re: [willydoit] Showing number of times a listing has been viewed

By Dave - December 7, 2010

Hi Willy,

Not sure if it's exactly what you want, but check out this post as well:
http://www.interactivetools.com/forum/gforum.cgi?post=68091#68091

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com