Increment Counter

5 posts by 4 authors in: Forums > CMS Builder
Last Post: June 9, 2012   (RSS)

By design9 - June 6, 2012

I have the php incrementCounterField code on a page to count the number of hits a picture is been voted on. However, the coding is counting the page views instead of when people click on the vote button. Is there a way to have it only count the hit when the viewer actually clicks on the vote button? The issue is that people may want to just see the detail page photo and not vote on that photo.

Thanks!
April

I have attached my details page as well in case you need to look at it.
Attachments:

traveldetails.php 26K

Re: [design9] Increment Counter

By gkornbluth - June 7, 2012

Hi April,

Take a look at this post.

http://www.interactivetools.com/forum/gforum.cgi?post=92168

Hope it gives you some ideas,

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] Increment Counter

By design9 - June 8, 2012

This really doesn't work for me because I am using an image. So, I think I still need to figure out a way to do this. Example, I have a facebook icon which is an image and I want to be able to count how many times users click on the icon to visit the facebook page instead of just the page view. the user may go to the page but not click on the icon so counting the page view is misleading.

Thanks!
April

Re: [Jason] Increment Counter

By Toledoh - June 9, 2012

If you use Google Analytics, you can easily achieve this with their _trackPageview() JavaScript.

ie.

<a href="http://www.facebook.com" onClick="javascript: pageTracker._trackPageview("/links/facebook.com");">

If you're inserting links via CMSB, just put the link as the href and as the trackPageview.
Cheers,

Tim (toledoh.com.au)