Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7491897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:11:34+00:00 2026-05-29T16:11:34+00:00

I was thinking to build a system for keeping visitor statistics for seperate web

  • 0

I was thinking to build a system for keeping visitor statistics for seperate web pages located in different domains. Probably the pages will be served as cached due to performance concerns although it’s created with php and has mysql/isam database.

I’m thinking to include a jquery code for all pages. here is the pseudo-code:

function(request, response) 
{
                $.ajax({ url: "http://www.mywebstats.com/post>",
                data: { page: <? echo $current_url; ?>, ip: <? echo $user_ip; ?>, session: <? echo $user_session; ?> },
                dataType: "json",
                type: "POST",
                success: function(data){
                    response(data);
}

And a similar but reversed function for showing visits for those web pages.

I think, i explained what i want to do. The questions are:

1- Is performance gain worth for that kind of approach ?
2- What kind of db storage engine should i use ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:11:36+00:00Added an answer on May 29, 2026 at 4:11 pm

    Suppose you were zany and Google analytics wasn’t fitting your needs –

    You could build a simple API for http://www.mywebstats.com and run a cron every 5 minutes to push to a receiving script. That way you’re not making a call on the fly every page load.

    Your local script would do exactly what you’re doing above except not to an external location. Your local script dumps the user data into a queue, which could be grouped by a token, session info or whatever data to track their browsing path, behavior, whatever. When the cron is called it fetches the last 100 records and sends it to your API.

    This should make sense to anyone that’s used cron before.

    As for data storage. It depends on how you’re going to interact with the data. Myisam sounds like it would serve your needs fine. InnoDB would simply be choice for you at this point. If you’re using some kind of ORM to retrieve records then you may need to go this route. Myisam for full text match against should you feel the need to run manual search queries on your stats. Kind of depends on what you plan on doing.
    Even if you were making the data public and potentially faced reporting millions of records on call, you can still optimize output to be compiled upon receipt where the users are fed a cached report for simplicity and ease on processing.

    In short – gather the data locally and use a cron to push it to your stats site. Myisam is fine for what this looks like. My opinion that is.

    UPDATE

    As for your question – Google Analytics has an API that you can use to fetch data:
    http://code.google.com/apis/analytics/docs/gdata/home.html

    I have never interacted with it but most likely it has what you might be looking for.

    As for separate DB interaction – Not necessarily. You could have one DB for any number of sites, but that wouldn’t make a great deal of sense. I mention what looks like 2 separate DB because your question looks like you’re calling a separate site that is intended to do only 2 things – record stat data and serve stat data. For that purpose, I would definitely say you should have this separated into 2 databases. Especially if there is more than one site calling the API.

    Your hit counters can easily be recorded on a cron as well. You would have a separate cron job on your stat site that computes the recently updated pages and updates a simple json string stored in association to the related page. That way your request is light weight. The from there you can either call the counter on the fly if you want to avoid another cron job – OR – you can run an additional cron that fetches the latest page counter results and stores them locally or writes them out to flat text for even further caching.

    The thing to remember is the term cron is not intended to be a scary thing. If your host allows you to set them up they are very convenient for basic maintenance and performance improvements… assuming you do them correctly. They still need to be structured in a logical way so you don’t end up writing scripts that run for 5 minutes or time out. But that’s another story. Hopefully you know what you’re doing enough to know what I mean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thinking about a Windows-hosted build process that will periodically drop files to disk to
i'm starting to build a part of a system which will hold a lot
I am thinking to build my own like system, as a way of learning
I'm trying to build (right now just thinking/planning/drawing relations :] ) little modular system
I was thinking how to build an automated system to pay users who got
I want to build a system using Django that will allow users to build
I'm thinking in build a iPhone app for get recipes. So, I'm looking for
I am thinking about build a online store for my wife to sale something.
Just thinking about the best way to build an Order form that would (from
I am thinking about how to build advertise site which works like twitter. That

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.