As site an owner, you are probably wondering what is the most accurate tool to use to measure your site’s performance – how many visitors it has, is it increasing its traffic and popularity, etc. There are different tools that report the data and measure it in different ways. Inspired by a common query, “Why do I see different results in these two tools?” Today we solve the mystery.
The data in all the different analytics and visit statistics tools varies, not just AWStats and Google Analytics. And the reason for this is not because one tool is reporting wrong and inaccurate data, but because of the different methods they use to track visitors, sessions, pages and site visits.
If you’re already using both tools, then you’ve probably noticed that for the same time period, Analytics data shows fewer visitors and pages viewed than AWStats. And this can be explained by the way the two tools work.
How does AWStats work?
– The data in AWStats
How does Google Analytics work?
– The data in Analytics
AWStats or Google Analytics – both tools!
How does AWStats work?
AWStats is a tool in cPanel / Directadmin that you can use to track the traffic of a site. Visits are grouped by months, days and hours, making it easy to spot a drop or increase in traffic. There is detailed information about visitors – country, IP address, browser, where the visitor comes from, and more. AWStats can be accessed through the cPanel » AWStats control panel. And Directadmin » User Statistics » Click on domain name » AWStats.
AWStats is an application that analyzes logs (logfile analyzer) for web server access. AWStats is installed and run on the server that hosts the site itself.
No setup or code needs to be added to the site to use AWStats. Also, this tool does not use HTTP cookies or JavaScript code on visitors’ browsers. Instead, AWStats reports visitors by their IP address. And the IP addresses are extracted from the web server logs.
All requests to the site are recorded in the web server logs. The records contain the information about the visitor’s IP address, the resource he searched for, date, time, status code and others. In cPanel » Raw Access you can see exactly what these logs look like, and in cPanel » Visitors (Recent Visitors) their tabular presentation. And the same for Directadmin.
AWStats log analyzer is available for all hosting services at CooliceHost.com.
The data in AWStats
In AWStats, the data that are close in meaning to the corresponding ones in Analytics, but actually different in detection, are the number of unique visitors (unique visitors), visits (visits) and pages (pages).
Unique visitor means a unique IP address in the logs for the selected period. This counts visitors as unknown to AWStats bots, automated scripts, system requests to the site from the site system itself or another server application, the site administrator or the user adding content to it. It is possible to exclude certain IP addresses from AWStats statistics that you do not want to be detected. This is done as in its configuration file, in the SkipHosts parameter, the given IP address/addresses are added.
The AWStats configuration file is located in the hosting account in the /home/user/tmp/awstats directory. If the secure https connection is enabled for the site, then the configuration file is located in the /home/user/tmp/awstats/ssl subdirectory. The file name is the name of the site, for example awstats.mysupersite.com.conf.
Visits in AWStats are based on a 1-hour session (unlike Analytics 30 minutes), during which the visitor viewed pages on the site. That is, 1 visit = 1 session.
Pages in AWStats are also URLs. Besides real web pages containing HTML code and having a .html extension, AWStats can count as a page any resource with an extension not specified in its configuration file in the NotPageList parameter. For example, when setting NotPageList=“css js class gif jpg jpeg png bmp”, the resources php, Unknown, woff2, woff, svg, eot, xml, ttf, mp4, pdf, txt (without robots.txt) will be counted for a page , because this file is excluded in the parameter SkipFiles=“robots.txt$ favicon.ico$”).
AWStats will report as a site visitor:
- Any IP address in the server logs, except those of known bots (Googlebot, bingbot and others) and those excluded in its configuration file.
- Unknown to AWStats is a search engine bot or automated script.
- A visitor who has disabled HTTP cookies in their browser.
- A visitor who has disabled JavaScript code execution in their browser.
- A system request to the site from the site system itself or another server application.
- The site administrator who maintains it.
- The user who adds content to the site.
- One visitor will be accounted for one IP address that is used by a network of users (office networks, home networks with one IP address).
- Multiple visitors will be counted for the different IP addresses that a single visitor uses.
AWStats will not correctly report visits when:
- The site uses a CDN (Content Delivery Network) such as CloudFlare.
- Due to CDN (Content Delivery Network) technology, the actual requests are not to the site itself, but to the servers of the CDN service.
- AWStats will show the IP addresses of the CDN service recorded when it requested the site’s content to copy it to its servers. In these cases, visit data may be reported to the CDN service.
- The site uses a web proxy (web caching and acceleration system) such as SuperCache.
- In the same way as with a CDN service, some of the requests to the site will not reach the site, therefore they will not be reflected in the server logs. From which AWStats has no way to find out about them. In this case, the use of Google Analytics is recommended for reporting visits to the site.
How does Google Analytics work?
Google Analytics is a service for analysis and reports of visits and visitor behavior on the site. With Analytics you can use reports, real-time data, audience data, traffic data, you can learn more about visitors, demographic data, mobile or desktop devices, sources of traffic to the site, direct or organic, social networks, email campaigns and many others.
The data collected by the tool is saved on Google servers. To use the tool, you must be registered at https://analytics.google.com.
To track visitors, Analytics uses JavaScript code on every page of the site in combination with HTTP cookies. On page load, the code executes and sends data to Analytics.
Visit and visitor reporting is only done in combination with the execution of the JS code and the cookie that is located in the visitor’s browser. If neither is available, there will be no visit reporting.
The data in Analytics
Analytics measures and processes much more data than AWStats, only some of them are New Users, Users, Sessions, Pageviews, Unique Pageviews, Bounce Rate, % Exit and others.
Data that are close in meaning but different in detection to that in AWStats are New User, Session, and Pageviews.
A New User in Analytics means a visitor who has a new unique identifier (Client ID) in the HTTP cookie. In reality, the new visitor may not be new if they have removed their browser cookies, opened the site through a different browser, used some browser application to block cookies, or are in incognito mode.
Session (Session) in Analytics by default is detected for an interval of 30 minutes, but this interval can be changed in the settings. If a visitor browsing the site logs out for more than 30 minutes and then re-opens the site, this will count as two visits, two sessions. It is important to note that there are many scenarios for reporting a new session in Analytics, see also: How a web session is defined in Analytics.
Display a page (Pageviews). For Google Analytics, a “page” is just what its tracking code is placed on. Only HTML pages containing the tracking code are counted, no other site resource is counted per page. Pageview is a metric defined as the total number of pages displayed.
Analytics will report a site visit when:
- The visitor has not disabled HTTP cookies and JavaScript code in their browser.
- The page that is loaded contains the reporting JS code.
Analytics will not count visits when:
- The visitor has disabled HTTP cookies and/or JavaScript code in their browser.
- The page did not load completely.
- The tracking code did not load.
- The visitor is a bot or automated script that does not support JavaSrcipt code.
To be able to take advantage of all the extras of the tool, it takes more time and thorough study.
AWStats or Google Analytics – both tools!
AWStats is the right tool when you want answers to questions like:
- Is the site crawled by bots and who are they?
- What IPs get the most traffic/visits?
- Which resource from the site is loaded the most, how many hits are there to it?
- What are the most frequently uploaded file types and most frequently downloaded resource from the site?
- How much traffic (MB,GB) was generated from the visits?
- What error statuses are there on the site?
- Are there any missing resources from the site that are generating a 404 error?
- Is there hotlinking (a direct link from one site to a resource on another site) to resources from the site?
- How do I use AWStats to analyze generated CPU time?
Google Analytics is the right tool when you want answers to questions like:
- How many visitors (unique) does the site have per day/week/month?
- Where do visitors come from and what do they do on the site?
- What are the search terms that visitors use to discover the site and lead to the completion of orders/goals?
- Can I track site visits in real time? How many visitors are currently online, whether they visited the site from mobile or desktop, what are the main pages they are viewing.
- What are the sources of traffic to the site – direct and organic traffic, visits from sites with links to the site (referral), paid search, traffic from social networks, email campaigns, etc.
- How do I track user behavior on the site and how they interact with the content on it?
- What is the percentage of visits that led to an order/fulfillment of a goal for a selected period?
- Can I track a visitor across domains to the site?
- Can I receive segmented reports as well as reports by email?
- I have an online store Shopiko – How to take the first steps in Google Analytics?
You can use AWStats to have data about the traffic and available resources of the site, directly from the generated server logs. But on the other hand, you will also need Analytics, which is a great tool for researching and analyzing site performance, visitor behavior, and measuring marketing strategies. This is how you will check whether a promotion, a post on social networks or changes to the site are achieving their goals and much more.
Tip: Depending on your goals, we strongly recommend using both tools. Once you know how the two tools differ and how they collect and report data, you will be able to use them in the most appropriate way and for the appropriate purposes.