Web stats for hit counter

I've got a nice hit counter built with help from these
forums. It's working beautifully. Now I'm building the web stats
page. (no I'm just using CF7 and don't have CFStat from CF8 yet) I
would like to display the total count for the month (which I've
got) and then the daily breakdowns with the count for each day. I
know there's got to be a dynamic way to set the queries up to do
this without building 30 queries or more. I also want it to be able
to continue through the years without me having to modify the
dates.
Right now my simple query looks like this.
<cfquery datasource="#dsn#" name="sept">
select referer, date from website_hits
where page like '%home.cfm'
and date >= '09/01/08'
and date <= '09/30/08'
</cfquery>
and the output is correct with
<cfoutput>#sept.recourdcount#</cfoutput>
But I know this is not good coding. I must be overwhelmed or
in a brain fog. Any thoughts?
Thanks, Wendy

Maybe I should be more specific. I got the monthly total
query working using this
<cfset today = #Dateformat(Now(), "mm/dd/yy")#>
<cfset daytostart= #DateAdd("d",-thedatepart,today)#>
<cfset daytostart = daytostart +1>
<cfset daytostart = #DateFormat(daytostart,
"MM/DD/YY")#>
<cfquery datasource="#dsn#" name="monthly">
select referer, date from website_hits
where page like '%home.cfm'
and date >= '#daytostart#'
and date <= '#DateFormat(now(), "mm/dd/yy")#'
</cfquery>
<cfoutput>#monthly.recordcount#</cfoutput>
<br>
But now I need to pull out the daily totals. I'm toying with
the query below. I'm assuming I need to loop this and be able to
increment the date where it's currently hard coded. Is there a way
to loop this and assign each date to a variable that I can use to
display in a table?
<cfquery datasource="#dsn#" name="thefirst">
select date from website_hits
where page like '%home.cfm'
and date = '09/01/08'
</cfquery>

Similar Messages

  • Web page visit - hit counter

    Please advise of any tutorial or example of a web visit counter. 
    I can create one that increments the count for each visit and refresh but really need something that will count unique visitors.
    Maybe use a session but not sure how to do it.

    Depending on whether this is a casual hit counter, or something more mission-critical, there's a number of ways to accomplish this.
    One option is to increment the counter, then place a cookie on the user's computer. If the cookie is present, don't increment the counter again. Set the cookie to never expire, or expire after a certain window of time (after which the user would be considered "unique" again). Only drawback to this is if the user clears their cookies, then returns, the counter would consider them unique no matter what. Second, you could store each visit as a row in a database, along with the user's IP address and a date/time stamp. Your code could then query that table based on the IP address, and only increment the counter if that IP address is not present. Depending on how long you want to consider a user "unique", you could filter the rows by date. Keep in mind that this could result in a large table, depending on your traffic, so it may be best to have some sort of cut-off time after which you would delete records.
    You could even combine the two methods, if you so desire.
    I'm sure there are many other ways this can be accomplished, but these are two simple means to accomplish your goal.

  • Hit Counter button not appearing when I upload the web site.

    I am using iWeb version 3.0.4 on OS 10.6.8, and on the Welcome page, I added the Hit Counter button.  When I upload the web site, the Hit Counter button does not appear.  Anyone have any solutions as to why it isn't appearing?  Thanks...
    Peggy Hinsman
    Eugene School District 4j
    Eugene, Oregon

    Where are you hosting the site? The counter will not work on ftp servers, only on MobileMe.  If you are hosting on MobileMe increase the footer height considerable and publish. If the counter then appears you can move it closer to the body/footer border and reduce the footer height.
    If you're not on MobileMe consider a 3rd party counter like StatCounter.  This tutorial describes how to add it to iWeb pages: #13 - Adding a StatCounter as an HTML Snippet
    If you're on MobileMe you know that MMe will be discontinued on June 30 of next year.  This may be of interest: #23 - Life After MobileMe
    OT

  • [SAP CRM] How to get just the hit count of objects with a database query?

    Hello,
    i need help. For performance reasons I dont want to get the query result with all the objects from the database. I just want to send a request / query to the database in order to know how many entries are there available with my search parameters.
    At the moment I load all the objects via class cl_crm_bol_dquery_service and the method get_query_result in an internal collection. And after that I call the method size in my collection object. But to gain better performance I just want to know the count. With standardized select statements I would take the select count statement, but in this case it is not possible.
    So I tried to call the retrieve_hit_count method, but I will receive the exception cx_sy_no_handler anytime.
    I would be very pleased to receive an answer <removed by moderator>.
    Thank you very much!
    Marcus
    Edited by: Thomas Zloch on Feb 16, 2011 1:45 PM - priority normalised

    It will be 0 before the call method statement and 1 during exception handling.
    The exception starts in CL_CRM_BOL_DQUERY_SERVICE=>RETRIEVE_HIT_COUNT when the system tried to perform the following statement:
      Return hit count if already available
        rv_hit_count = me->handle->get_hit_count( ).
    The handle variable seems to be empty. But why?
    Edited by: Marcus Findeisen on Feb 17, 2011 9:24 AM
    Edited by: Marcus Findeisen on Feb 17, 2011 9:27 AM

  • Hit Counter not appearing.

    OK I'm using iWeb, the URL is at Godaddy, but the hosting is at my /mac account. I have the family pac. Two web sites the hit counter works just fine. A third one I got it to work on a page where I don't need it, but can't get it to SHOW on the page where I want it. I've tried to put it anywhere on the page, and have restarted etc etc. Suggestions?

    what is the purpose of your link? hit counter? or pushing wares?
    there are only links on your page, people can google 'hit counter'...
    ... at least, you should show an example of what looks like iweb hit counter.
    here is bling: http://www.cyclosaurus.com/Home/Cyclosaurus.html
    (to the left) it looks like iweb hit counter, but it is a StatCounter.

  • 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?

  • 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?

  • 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

  • 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

  • Iweb hit counter stats

    I know I can get a 3rd party hit counter, but I am curious if I can see how many hits my site has received without visiting the site itself? In the old, old .mac Homepage you could see how many hits yoru site received when you logged into your .mac account on Apple's website. Is there a place to do this with iweb? I don't need any fancy stats. Just curious about hits.
    Dan

    http://www.apple.com/feedback/iweb.html
    http://www.apple.com/feedback/mobileme.html

  • Stats for Web reports

    Hi Friends
    We are using portals to run reports.When the queries run on Bex analyser, stats recording fine but however when we run the queries on Portals,the stats are not recording.
    Then I did load data from RSDDSTAT table into 0BWTC_C02 cube.Now no.of navigation isok but overall time and meantime are displaying as '0'.
    What is the correct solution to record bw stats for web based queries?
    Regards,
    Chama.

    Hi
    My problem is not the performance problem.
    When query ran on portal then BW stats not showing the details of meantime ,overall meantime,time olap processor etc.
    When I run the stats query '0BWTC_C10_Q010' - Utilising OLAP, It's showing only number of navigations and it's showing remaining all the fields '0'.
    How can I resolve this problem.
    Regards,
    Chama.

  • Web Services for a State Machine Based VI

    Hello,
    I am new to the Web Services approach but so far I have managed to build a simple VI which is used with Web Services to display a Graph and make some simple calculations.
    However, I have a more complex application which uses a State Machine architecture to command some circuitry using the NI USB 6211 device. This program includes different states and all the action takes place inside a while loop. This loop uses shift registers to pass the states arround (the JKI State Machine).
    My question is: Could such a program be used with the Web Services without modifying this structure?
    In the programs that I have tried, if I place the execution inside a While structure then I get no result with the Web Services. 
    An example of a simple program which includes a while loop and the Web Services approach would be helpful, if possible.
    Thank you in advance.

    Hello again,
    I was trying to do what Nathand indicated.
    1. "Put a functional global in it that stores whatever value you want to be queried over the web,"
    So I opened a new Project and added the Index.vi just to generate the numbers continuously. This VI writes to a global variable entitled "GlobalOutput.vi".
    This works as I have attached the jpg image.
    2. "and make that VI accessible through VI server."
    This I am not so sure I did correctly. I opened the Tools->Options->VI Server, and here at the section Exported VIs, I added the GlobalOutput.vi. I have attached the image.
    3. "Then, in your web services VI, open a VI server connection to that functional global and run it, by reference, to obtain the value stored there."
    Now I have created another VI, called ServerConnection.vi which runs the GlobalOutput.vi. I have attached the image with the error I get. Something is wrong in what I am doing. In the end I thought that I would create a Web Service for this last vi and basically be able to read the global variable.
    As I understand it, you have a VI which runs locally, in a while loop and updates some global variables. Then another vi reads the values of those global variables.
    It is this last vi that you should create a web service and interogate to find out the values of those variables. What am I missing?
    Thank you in advance.
    Attachments:
    GlobalVariable.JPG ‏21 KB
    ViServer.JPG ‏36 KB
    error message.JPG ‏38 KB

  • No stats for Web queries

    Hi Friends
    We are using portals to run reports.When the queries run on Bex analyser, stats recording fine but however when we run the queries on Portals,the stats are not recording.
    Then I did load data from RSDDSTAT table into 0BWTC_C02 cube.Now no.of navigation isok but overall time and meantime are displaying as '0'.
    What is the correct solution to record bw stats for web based queries?
    Regards,
    Chama.

    Hi
    My problem is not the performance problem.
    When query ran on portal then BW stats not showing the details of meantime ,overall meantime,time olap processor etc.
    When I run the stats query '0BWTC_C10_Q010' - Utilising OLAP, It's showing only number of navigations and it's showing remaining all the fields '0'.
    How can I resolve this problem.
    Regards,
    Chama.

  • Web hit counter

    Can someone lead me in the right direction to making a hit counter in Java Studio Creator? The counter in staticText1 should increment every time some one hits the submit button. I didnt increment yet because I am getting errors when I try to parse it.
    public String button1_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            String counter = (String)staticText1.getValue();       
            Cookie cookie = new Cookie(counter, "1");
            int counter = 1;
            cookie.setMaxAge(60*60*24*30);
            HttpServletResponse response =
                    (HttpServletResponse)getExternalContext().getResponse();
            response.addCookie(cookie);
            staticText1.setValue(counter);
            return null;
    public void prerender() {
            HttpServletRequest request = (HttpServletRequest)getExternalContext().getRequest();
    I really dont know if I am doing is right.  I know I need to parse the counter in an int but I need a lead in the right direction.  Can anyone help?

    I moved everything to the prerender method. And I made a few updates. However all i get is Blah. Anyone at all know how to fix this?
    public void prerender() {
            staticText1.setValue("Blah");
            HttpServletRequest request = (HttpServletRequest)getExternalContext().getRequest();
            Cookie [] cookies = request.getCookies();
            if(cookies.length>1){
            for(int i=0;i<cookies.length-1;i++){
               Cookie cookie = cookies;
    String counter = (String)staticText1.getValue();
    Cookie cookie = new Cookie(counter,"1");
    HttpServletResponse response =
    (HttpServletResponse)getExternalContext().getResponse();
    response.addCookie(cookie);
    int count = 0;
    count++;
    try{
    count = Integer.parseInt(counter);
    }catch(NumberFormatException nfe){}
    cookie.setMaxAge(60*60*24*30);
    staticText1.setValue(counter);}

  • How does the hit counter work?

    hi
    a while ago i made a web site with a hit counter on it
    i wrote the hit counter using php and a flat text file to store the number of hits
    i experienced a number of problems
    1. if someone visited the site more than once, the hit counter would go up each time they visited. this is not really desired as i really only want to know how many unique hits i get
    2. web bots and web crawlers would also make the counter go up
    does the hit counter that iweb generates suffer from this problem?
    how does it work - from total hits or only unique hits?
    does anyone know it web crawlers effect the counter?
    thanks!

    It is a hit counter and will register even when you visit the website.
    I found this annoying, so I ditched the iWeb hit counter and went to Bravenet and downloaded a visit counter instead. You can customise your design and can have a visit counter instead of a hit counter and you can also set it to ignore your own hits - so if you want to visit your site to see how it looks it won't register your hit. The hit counter will register each time and for every page, whereas a visit counter will just register the visit to the first page and then thats it. If you use Bravenet it will give you stats too.
    I am sure you can get hit counters and visit counters from lots of other sources though.

Maybe you are looking for

  • I am trying to Install CS5.5 on a new computer and it is saying my product key is valid but a qualifying product cannot be found.

    I have Adobe CS 5.5 with a valid product key (On the original box) but it wont install on my new work computer. This product is owned by my company and has been used in the past on my old computer. I enter the product key and get the customary Green

  • Partial or Residual Payment

    Hello folks, I would appreciate some assistance on the following question. POINTS AVAILABLE. <b>What is the difference between the Partial Payment and Residual Payment tabs in F-28 or F-52?</b> When do I use one versus the other? Let's say for exampl

  • Doubt in MM alerts

    Hi all I have one doubt in alert. Can we send list of documents like list of sales order, Pos lists etc to inbox or EP alert using sap alert? i want to send alert to EP and sap inbox my req. 1. POs pending for invoice verification. POs pending for pa

  • Parsing a xml file

    i need a code for this... write a class for "myxmlparser" to parse "*.xml" fileto "*.dtd" file. sundar

  • Please help me,bought phone and know its not working in my country

    Hi, I bought a blackberry curve 8520 in the Dominicans republics, and when I came back to Norway, the phone will not work. Is there somebody who can help me, or is all hope out....