Analytic code - is it such an interesting thing?
Web applications are everywhere and most of us test them to earn our bread and butter. Broadly speaking, there are two types of web applications or websites - One which provide service and another which provide content. Web applications such as emails, facebook, bank or blogging platform provide a specific service and BBC, Times and many such sites provide content.
Irrespective of the type of web application, all of them need to understand user behaviour on the site and gather key usage pattern. One common way of doing this is with the help of analytic code. As a tester, it is important for us to understand how it works and how it can be tested. In this entry, I will discuss this in more detail and show you how iCheckWebsite can be used to test analytic code.
So what is Analytic code? Analytic code is usually a java script snippet which is included in all the pages of your website. This java script snippet does not have any behavioural impact on the application and is invisible to the end-user in most of the cases. Every time a page is loaded, these scripts get executed and store key information about the users browsing pattern. With this data it becomes easy to find information such as -
- From which link they have come to this page
- For how long they are staying on this page
- Where are they going from this page
- From which part of the world they are coming
- Which browser they are using
- And so on..
This information is extremely valuable for the organization because they base their marketing activities on this data. It also becomes useful for people who want to advertise on a the site as it gives them data about the popularity of site.
As a tester, it is important for us to ensure that correct analytic code is present on all the pages of web application. Sometime it becomes a bit more complicated because you have different parameters in the analytic code depending on a specific section of site. Also, checking it manually even on few random pages is time consuming, tiring and prone to error.
Fortunately there is a better way to check presence of analytic code on entire site - using an interesting product iCheckWebsite. iCheckWebsite does this task automatically and lets you focus on other important parts of the web application testing. In the remaining part of this article I will show you how I used one of the ‘Custom Rule’ check of iCheckWebsite to find out presence of analytic code in TestingGeek. It is simple 4 step process:
- Sign in and go to ‘Add Rule’
- Now go to the ‘Schedule Execution’ page and click on ‘Check Now’ for the web site you are interested in.
Within a few minutes (for a few hundred pages) and a few hours (for a few thousand pages) the checks will be done and depending on the preference, results will be sent in the email after execution is completed.
So an important, tiring and prone to error manual task can be automated using this nifty tool to find presence of analytic code on all the pages.
Hope it is useful in your projects.
Do you like this post?
Subscribe to receive new posts via RSS or email. Join!

