Hits counter issue

I just set a simple counter to track hits on multiple pages (4 to be exact) using a fairly simple Coldfusion code. Now, maybe I am crazy, but my issue occurs when (this is surely questionable) the adsense code is present on the page!? Simply put, it acts weird all the time, adding +2 or +3 instead of +1?
here is the code:
<cfparam name="URL.ID" default="1">
    <cfquery name="updateHits" datasource="mydatasource">
          UPDATE table
          SET TOTALHITS = TOTALHITS + 1
          WHERE ID = <cfqueryparam value="#URL.ID#" cfsqltype="cf_sql_clob" maxlength="75">
      </cfquery>
what seems to be the problem? should I use cffunction perhaps, on the page or in cfc?
I am running CF MX7.

Various distinct pages could send the same url.id to the server, for example,
page1.cfm?id=1
page2.cfm?id=1
page3.cfm?id=1
and so on. Hence, it isn't yet clear to me why you use url.id to count page hits.
Owain has already hinted at a more reasonable solution. The page count is performed in onRequestStart in Application.cfc.
Create a table, say pageHit, with columns id(autoincrement int), pathFromRoot(varchar), hits(int). You could, for example, already insert all the possicle CFM pages of your site into  the pageHit table, giving each an initial hits count of 0.
Here is an example to illustrate. My sample site has just 2 CFM pages. The paths are relative to the webroot.
pageHit (database table)
id = 1
pathFromRoot = /testDir/page1.cfm
hits = 0
id = 2
pathFromRoot = /testDir/page2.cfm
hits = 0
The calculation for the page hits is:
<cffunction name="onRequestStart">
<cfargument name = "targetPage" type="String" required="true">
    <cfset var detectPage = queryNew("","")>
    <cfset var countPage = queryNew("","")>
   <!--- identify current page --->
    <cfquery name="detectPage" datasource="my_dsn">
        select id
        from pageHit
        where path = '#arguments.targetPage#'
    </cfquery>
   <!--- update number of hits --->
    <cfif detectPage.recordcount GT 0>
        <cfquery name="countPage" datasource="my_dsn">
            update pageHit
            set hits = hits + 1
            where id = #detectPage.id#
        </cfquery>
    </cfif>
</cffunction>

Similar Messages

  • Counter issues with 2D raster scan and count acquisitio​n

    I am building a confocal laser scanning microscope and am currently attempting to develop labview controls for it. I have a fast steering mirror (FSM) which takes analog voltage inputs to control it's x and y angle and I have an avalanche photo diode (APD) which sends a TTL pulse for each photon detection event. For now, I am trying to create a program which will send out two analog signals to create a 2d raster scan with the FSM and count the number of pulses from the APD per pixel. I have been trying to make the program from https://decibel.ni.com/content/docs/DOC-5779 work, but I keep running into counter issues. I am using a generated pulse train from the other counter on my device (NI 6011E) as the period.term input, but I get a "Two consecutive input signals occurred without a counter timebase edge" error if I increase the frequency of the pulse train too high. Unfortunately, the number of pixels I can acquire seems to be limited to twice the frequency of the counter, so I cannot just use a lower frequency train. I believe that the error is occurring because the count rate from the APD is very low and that there are simply no photons hitting the detector in the time period between pulses.This is not a problem, but I would like to know how to simply record a 0 and continue with the scan, rather than have the entire program exit with an error.
    Alternatively, if this does not seem like the correct way to accomplish what I am trying to do, I am open to new directions.

    So simply ignoring the error did not work, because the DAQmx subroutine stops collection when the error is detected. I think I may need to come up with a different approach to synchronize the counting of TTL pulses with an analog output. Attached below is the code I have been working with.
    Attachments:
    Raster_2DOutput_wCounter_82.vi ‏45 KB

  • Access list hit counts

     Hello Mates,
    Am getting a very rare type problem while I implement the aCL on 3850 switch
    I do get hit matches when I put a log keyword in the ACL 102
    SW#sh ip access-lists
    Extended IP access list 102
        5 permit tcp 192.168.0.0.0 0.0.255.255 196.189.80.0 0.0.0.15 eq 23 log (28 matches)
    But when I remove the log keyword then I don't get any matches.
    SW#sh ip access-lists
    Extended IP access list 102
        5 permit tcp 192.168.0.0.0 0.0.255.255 196.189.80.0 0.0.0.15 eq 23 (no matches )
    Please assist.

    To understand your issue I think it is helpful to start from the understanding that the hit count is maintained as the access list is processed in software (as is generally the case in layer 3 routers). We get a somewhat different situation in layer 3 switches. If the access list is processed in software (as is necessary when the entry includes the log parameter) then the hit count increments. But when the decision is made in hardware then the right behavior of traffic is achieved but the hit count is not incremented.
    HTH
    Rick

  • Hit counter on .Mac

    I've found that since upgrading to iWeb '08 the hit counter under My Pages on my .Mac home page is no longer there. It worked fine while I was working with iWeb '06. Everything else appears to be in order. The hit counter is working on the web page itself. Anyone with similar experiences?

    I am having a similar issue: hit counter worked for a while but today it no longer appears in published folders/internet. Could there be a corrupt file(i.e .plst)?

  • Hit Counter For Web Site

    I've published a site to .Mac for a friend, and her domain name, which is hosted on godaddy is being forwarded to the .mac site. I'm using masking so only her domain name shows in the address bar of each page. That's all working well.
    I've added a hit counter through iweb to the first page but it won't show up when I go to the site by using the domain name. If I go to it using the .mac address it shows up. What's odd is if I go to the site first by using the .mac address where the counter always shows up then go to the site by putting in the domain name it will then show up there as well. If I go to the site again later by the domain name-no counter. If I repeat this by using the .mac address first then going back, it's there.
    I read other past posts about this issue but I didn't see if it could be completely resolved. I normally use Safari but even when I use Firefox it doesn't show up either.
    Can anyone help?
    John

    John:
    If you added the hit counter from within iWeb then that's the reason it doesn't show up. It will only work on the .Mac server.
    What you need to do is use StatCounter.com. It requires some post publication editing of the page that you want the counter on. If you make changes to the page later on then you'll have to reedit the page again.
    What has been suggested is to put a text box with "STATCOUNTER" in it where you want the counter to appear. Then in the post publication file, search for STATCOUNTER and replace it with the code that the site provides you.
    With that you can get daily, weekly hits, a world map of where the hits came from and lots more. There's a variety of text or image counters.
    In this site, Old Toad's Tutorials I put the STATCOUNTER in the main text box at the bottom and make the text orange. When I added the counter, it comes up in the text and color that I chose. If you put it in it's own text box, you can use the stye that StatCounter provides when you set up the counter.
    Do you Twango?

  • Video set to autoplay causes hit counter to double count

    on my website i have a video set to play immediately (set to autostart). but for some reason, when viewing in FF, this makes my .php hit counter increment by 2 (or sometimes even 4).
    on other pages that have videos that are played manually, the hit counter works fine. but if i add autoplay video, the counter goofs up.
    chrome doesn't have this problem on any pages, nor does IE.
    i have reset FF to factory. v13.0.1

    j -
    i have read your suggestion several times, and i can't say that i completely understand it.
    "specifying your character encoding in an HTTP header sent before Firefox actually starts parsing the document. This has been reported as an issue in some shopping cart applications: failure to do this can cause Firefox to re-request (re-submit a request) when it comes to the meta tag specifying the character set. "
    i can't tell from these words whether it should be done or not (this has been reported as an issue & failure to do so ...).
    this is what is currently at the top of my page :
    &lt!DOCTYPE html&gt<br/>
    &lthtml lang="en"&gt<br/>
    &lthead&gt<br/>
    <meta charset="UTF-8"><br/>
    <title>DRAGON ART STORE - Home Page</title>
    <br/>
    if i understand you correctly, it would be better like this :
    &lt!DOCTYPE html&gt<br/>
    &lthtml lang="en"&gt<br/>
    &lt?php<br/>
    header('Content-type: text/html; charset=utf-8');<br/>
    ?&gt<br/>
    <head><br/>
    <title>DRAGON ART STORE - Home Page</title>
    is that what you had in mind ?

  • Problem with ACLs hit counts

    Hello
    I've applied the following ACL to an interface but don't see the hit counts (e.g. something like
    30 deny tcp any any (58 hw matches)):
    RP/0/RSP0/CPU0:test#show access-lists ipv4 2020
    Fri Aug 26 09:34:48.094 HKT
    ipv4 access-list 2020
    10 deny ipv4 any host 202.146.219.55
    20 deny ipv4 any host 218.213.235.211
    30 deny ipv4 any host 116.193.159.79
    50 deny ipv4 any host 111.68.2.101
    60 deny ipv4 any host 112.121.170.43
    77 deny ipv4 host 117.211.87.202 any
    78 deny ipv4 host 202.29.220.238 any
    79 deny udp any host 218.213.92.3
    80 deny udp any host 218.213.91.45
    81 deny ipv4 host 59.42.249.51 host 218.213.91.45
    Also got the following:
    RP/0/RSP0/CPU0:test#show access-lists ipv4 2020 hardware ingress interface gigabitEthernet 0/0/0/31 sequence 81 location 0/0/CPU0
    Fri Aug 26 09:34:52.209 HKT
    The interface does not have per-interface statistics enabled
    RP/0/RSP0/CPU0:test(config-if)#ipv4 access-group 2020 ingress  interface-statisticsRP/0/RSP0/CPU0:test(config-if)#commitMon Aug  29 09:44:42.725 HKT
    % Failed to commit one or more configuration items  during a pseudo-atomic operation. All changes made have been reverted. Please  issue 'show configuration failed' from this session to view the errors
    Is there any configuration still missing?? 
    Pls help.  Thanks!

    Thanks!
    Have tried but still got the following:
    RP/0/RSP0/CPU0:test(config-if)#show config failed
    Wed Aug 31 09:41:58.730 HKT
    !! SEMANTIC ERRORS: This configuration was rejected by
    !! the system due to semantic errors. The individual
    !! errors with each failed configuration command can be
    !! found below.
    interface GigabitEthernet0/0/0/23
    ipv4 access-group 2020 ingress hardware-count interface-statistics
    !!% 'pfilter-ea' detected the 'warning' condition 'Mode mismatch.ACL has been applied in different modes on this LC - interface stats and ace stats. '
    end
    Could you let me know the reason?  Thanks again.

  • 2nd Hit Counter on Site not showing up on different page

    I am so close to being done with my Illustration website- 11 pages and only one last bug I can't figure out. I have a second Welcome page that I have hidden and not yet posted. I have no idea where the the hit counter is on the page, it is checked off as there- it doesn't load online or visible on iWeb, yet Insert/button has it as there. I have another hit counter on the site that works fine. I have saved, relaunched, no hit counter on this page. Deleted it, tried again and no luck.
    Here is the site:
    http://web.mac.com/yvette
    The page that I am working on but is not in the menu:
    http://web.mac.com/yvette/iWeb/Site%204/Welcome.html
    The hyperlink works fine but no hit counter.
    Thanks-
    Y

    no hit counter on this page
    The hit counter is in the footer area, but you set the page content height too short, set content height longer or move hit counter out of the footer and into body area.
    One other little issue- On my Menu, the "Fantasy" link doesn't let you use the Fanatsy section at the top of the page. It is one of 11 pages, all connect fine, this one is at the upper most right top
    I think it is block by this image: http://web.mac.com/yvette/iWeb/Site%204/Menufiles/shapeimage9.png
    You need to send it backward.

  • How do I add a hit counter to my website?

    How do I go about adding a hit counter to my web site?
    I am running Adobe Dreamweaver CS6.

    Humm.......hit counters are meaningless. They don't provide accurate figures of who has visited your website.
    You'd be better off putting Goolge Analytics on the site - that will give you more accurate feedback.
    If you want to just have some fun Google Web Counter - there are plenty of free resources where you can download the code needed and insert it into your websites page.
    Just grab the code and paste it where you want the counter to show up on your page (not recommended)
    http://www.simplehitcounter.com/

  • How do I add a hit counter to my Gallery?

    So much I can't find instructions for on this board, in FAQ or in iWeb or iPhoto help.
    Anyone know how to add a hit counter to the gallery used when iPhoto publishes pictures?

    I still have not been able to add a hit counter to my gallery. I have no problem adding them to iWeb pages so it is frustrating that it's not as easy.

  • I need Java code for a simple graphical hit counter for a webpage

    I was wondering if anybody out there could send me some code for a simple graphical hit counter for a webpage. All the sites that I've visited are garbage and of no use to me. Please help me.
    Colin

    Not as easy as you'd imagine with applets. You need some way to store the hits, usually through a file on the server. That's not gonna happen in a hurry for 2 reasons -
    - Applets can't read/write files
    - Your web server usually won't let you run programs on their machine (ie, programs that listen for socket connections from applets, then load/read/write/close a file).
    In short, no, there is no simple java solution (that I know of).
    Cheers,
    Radish21

  • IWeb Hit Counter Widget

    My counting widget has disappeared from the widget list in iWeb. I deleted it from my page. How do I get it back?

    Try using the Insert->Button->Hit Counter menu option. If that fails then you might have to reinstall iWeb from the disk it came on. To do so you'll have to delete the current application and all files with "iWeb" in the file name that reside in the HD/Library/Receipts folder. Reinstall iWeb and apply the latest updaters.
    OT

  • Hit Count for a KM Folder

    Hi,
    Is there any way we can track the hit count for a particular folder in KM?
    Is there any particular default event where we can listen for this?
    Helps will be appreciated...
    Regards
    BP

    Hi BP
    This is the most recent information om KM statistics by Thilo Brandt:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7d28a67b-0c01-0010-8d9a-d7e6811377c0
    I don't know if it is possible, but I'd guess it's possible to alter that code in order to get some statistics on folder-level as well as item-level.
    Kind regards,
    Martin Søgaard

  • Hit Counter For Web Site Now Working?

    I have a web site that was published with iWeb 06. I am using a domain name at GoDaddy and forwarding to .Mac using masking so the site shows with the domain name not the .Mac address. If you went to the site by entering the domain name the hit counter on the first page would not show. However, if you entered the .Mac address to go to the site the counter would show.
    Well the site was republished and upgraded with iWeb 08. Recently I noticed that the hit counter now shows regardless of how you go to the site. I was pleasantly surprised but when did this happen? Of course as others have noticed, on my .Mac home page on the side bar where the website pages are listed the counter numbers no longer show. So they took something away and gave something back?
    John

    I don't think Apple meant to take away the .Mac counter section of the .Mac page. I think it's a bug that they have yet to resolve. It would be interesting to see if anyone has asked Apple about this and if they gave a definitive answer?

  • How do i get a hit counter on my site

    Hi everyone
    Im looking for a we hit counter for my site, but it seems
    like its abit more complecated than i want it to be, or am i
    getting it wrong?
    I have looked on the dreamweaver exchange, i dowloaded one
    called 'visit counter v.1.0' by felixone, and it says its on the
    server behaviours panel under the 'felixone' menu, but i cant find
    the server behaviours panel.
    Can anyone help? or does anyone have a good link to an easy
    to use one?
    Thanks

    You realise that 'hit counters' are pretty old hat and look a
    bit amateurish
    on a site these days :-)
    Check with your host, they may have a stats program that you
    can view to
    check out what hits and other information you can gather by
    the visitors to
    your site.
    If you really want a hit counter, you may be ble to find
    something at
    www.hotscripts.com
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    ~ Forum Posting Guidelines ~
    http://www.adobe.com/support/forums/guidelines.html
    CSS Tutorials for Dreamweaver:
    http://www.adobe.com/devnet/dreamweaver/css.html
    > Hi everyone
    >
    > Im looking for a we hit counter for my site, but it
    seems like its abit
    > more
    > complecated than i want it to be, or am i getting it
    wrong?
    >
    > I have looked on the dreamweaver exchange, i dowloaded
    one called 'visit
    > counter v.1.0' by felixone, and it says its on the
    server behaviours panel
    > under the 'felixone' menu, but i cant find the server
    behaviours panel.
    >
    > Can anyone help? or does anyone have a good link to an
    easy to use one?
    >
    > Thanks
    >

Maybe you are looking for

  • Problem beim Start von Camera RAW in Bridge cs6

    Hallo, ich habe soweit alle chats durchgesucht aber keine passende Antwort gefunden. Mein Problem ist das folgende: habe die" Adobe Creative suite produktion premium cs6" im September 2012 gekauft. Ich mache den ordner mit den Fotos in Bridge auf, so

  • Problem in J1iin for Export Invoices only

    Dear All, I want to create Excise Invoice for Export. We are using Letter of Undertaking ( LUT ) for our export. My Billing Document shows the values for BED, Cess & SHE Cess. While J1iin , It also shows the BED, Cess & SHE Cess values in there appro

  • Slideshow with Music - Viewing Options

    I created a Slideshow with vacation photos, etc. on my basic mini with DVD read/CD read-write capabilities. From what I can get from Photo Help, I can burn pictures to a CD and I can burn songs to a CD but I cannot burn a Slideshow to a CD to send to

  • System management software for LV apps on cRIO and Windows

    Hello All, Were I work there is a LabVIEW based project that is a distributed system. This system has a main application that can run on Linux, Windows, or cRIO targets. The main application loads "plugins" depending on what platform it is on to do p

  • Disks disappear from my desktop even though they haven't been ejected

    This started happening a couple of days ago... Randomly, whatever CD is in the drive will disappear from my desktop even though I haven't ejected the CD. The only way I've been able to get it to reappear is by ejecting the CD and then re-inserting it