| HOME PAGE |
| SEO NEWS & ARTICLES |
| SEO TOOLS |
| SITE INDEX |
| CATEGORY INDEX |
| KEYWORD INDEX |
| SUBMIT YOUR WEB SITE |
| SEO CODES |
| LINK EXCHANGE LIBRARY |
In this section you will find self help search engine optimization codes that you might need while optimizing your web site 's visibilty rate. Codes here are provided by contributors from www.phphints.com which is under development right now.
Keeping logs and analyzing the data gathered for web servers is one of the key aspects of search engine optimization. Below is a function coded in php & mysql which is capable to store basicly any information avaliable from a client requesting data from your web server. To have your own web traffic log analyzer you need to have few things avaliable with your hosting package such as it should allow you to run server side scripts and you should have access to any kind of database. Right now i m posting a code that works with php & mysql. The method used below requires certain space on your hosting but it gives you full control over your logs
//Here is the mysql syntax to create a database where we will store traffic information for our web pages. The fields listed below are if defined by the browser requested url,request date and time, parameters from Get request, parameters from POST request, request method to web server, client language, client user-agent,client cookie, referer and other fields if defined bytcp/ip clients ip address, clients connetion port. After creating the table we will code a function that will store the data we need to analyze afterwards. Function uses global variables defined in php itself as parameters , parses them and then stores them in database for generating reports later on.
sql commdand line
//And here is the php syntax to create a function to parse the data received and store it into the database table we ve just created.
library.php
//Right now we need to call the function above from a php file also it is a good habit to store your functions in a diffrent file in php to create a library so i ll assume the function above is saved ina a php file called library.php
test.php include('library.php'); echo "welcome to my site. I am logging everything for security and search engine optimization reasons."; logstats($_SERVER,$_GET,$_POST);
//So now we have all the information we need in our database. Whats left is that we need to processthe data so it will be something meaningfull for us. Like generating reports for daily visits.Or anything else we just need to add new functions to our table. I dont want to get in too deep into programming so i ll create functions and sql 1 by 1
select logrequestremoteaddr, count(*) from logstats where date_sub(now(),interval 1 DAY) > logtime group by (logrequestremoteaddr) ; //The query above will return ip adresses of visitors and the number of requests they have made to your web site today. What we have to do is to create new functions to parse the data. (Note: since this project is under development i ll will make additional updates on the script till it is a standalone web application.)
library.php //Now that we have some functions we can use them to parse the data and have some stats finnaly :). The code below will return unique ips on periodic bases on dynamic ip system it would only be assumption to categorize ips as unique so a timestamp should be used as base standart to differ unique ips and unique users or it can be grouped by daily bases. I will decide on that while developing this application. Same problem also occurs on every log and traffic analyzers even google analytics can not solve that problem. Even if you dont take ip as only unique index even user-agent variables or any header sent by any browser can fool analyzers. Only if you monitor tcp/ip packets and compare mac adresses you may get an accurate result but thats also relative to the time being analyzed. 1000 users behind a proxy could visit your site and you would see only 1 unique visitor or 1 user can visit your site 1000 times in 2 hours. The structure of your web site and content you provide can be used to determine some parameters to define what is unique visit and what is not.
analytics.php // Ok so we will define unique visits based on daily hits from an ip since it seems like the most logical approach to get an accurate result. After all Web pages are ranked by their daily visit rate. So we have to modify our sql syntaxes in our functions and add a column to group by syntax
// Now we have a working date based counter. But knowing how many unique visitors our site has doesnt help us enough on our efforts to increase our search engine visibility rate. But hey we have all the data we need in our database so we should get into details we should be able to see who is visiting our web site and for that we have to add new functions to our library.
| HOME PAGE | SEO TOOLS | SITE INDEX | CATEGORY INDEX | KEYWORD INDEX | SUBMIT WEB SITE |