In the
Rating , as well as in other web statistics systems, page viewing tracking exists long ago. You could always see how many times visitors looked at the page with contacts, the page with purchases, and even track the viewing of the page with gratitude for the purchase. However, some events in the life of the site can not be traced in this way: downloading a file, watching videos, events in Flash and Ajax-sites, the occurrence of errors.
In the end, we decided to make the functionality of tracking the achievement of goals. In short, the goal is the event that we expect and which we want to track.
As a goal, you can track:
- file download
- online purchases: adding a product to the cart, ordering and payment
- events in Flash and Ajax sites, watching videos
- registration on the site
- errors and other interactions on the site
- external link clicks
- view a specified number of pages
- ... offer your version?
In principle, the number of products in the cart, the user can track the volume of purchases in his accounting records, and downloading files in the server logs. However, the Rating provides an opportunity to immediately see the full picture without time-consuming.
Applying tracking of the objectives of the Rating, it is possible to distinguish among all visitors of those who are most important for the site from a business point of view. The rating provides an opportunity to find out where the online store customers came from, track down sources that attracted loyal readers of the news site or registered users for games.
')
Thus, it turned out successful communication with another report made earlier - Sources of visitors. In each case, we can find out the source of the visitor. This allows you to assess which sources give more registrations, and which - less, even if several days have passed between the first visit and registration.
Let's see how to use it all.
As a goal, you can choose one of the following options:
- Visit a specific page or group of pages (determined by the full or partial coincidence of the address), setting the rule for the page address (URL).
- Follow a link from a specific page or group of pages by setting a rule on the Referer.
- Visit a specific number of pages by specifying the number of page views.
- Fulfillment of an arbitrary condition that can be defined using JavaScript, then - JavaScript target (for example, adding a product to the cart, downloading a file or watching a video). Upon reaching the desired event, information is sent from JavaScript.
Typical cases of life.
To track the departure to an external resource by reference, we put a click handler on the link. From the handler, information about the achievement of the goal is first sent, then the link is followed. Here it is necessary to make a delay so that the information has time to go.
The number of registration failures and the number of successful registrations can be tracked using rules on the page address or a JavaScript target.
Adding goods to the cart. If goods are added via a GET request (including through a form), then you can put a condition that the page address contains a substring that is found only in requests for adding goods. If you cannot select a substring, you can add an artificial parameter (in the URL or hidden-field in the form). In the case of a POST form or the use of Ajax, you can use the opportunity to send a JavaScript event to reach the goal. Also, do not forget to specify the page with gratitude for the purchase as a goal - this will allow you to know the number of purchases made.
Video viewing can also be fixed using JavaScript targets.
Another interesting case is keeping track of how many times a user has stayed on a page more than a specified number of seconds. At the same time, you should send a JavaScript event after a specified time. If users quickly close the page, then maybe something is wrong with the page. In the case of advertising campaigns, this may signal a poor quality of attracted traffic.
And what next?
As you begin to track goals, you will see the sources of visitors who have reached the goal.
As a source, we show the last most significant source of visitor attraction. Sources can be ad campaigns with links to pages containing UTM tags, _openstat, or a given string. Also, referrals may come from search services or from sites that you specify. For the convenience of the user, the transitions in advertising campaigns with tags and transitions from search engines are tracked as a source of the visitor automatically.

We also took into account that between the moment when a visitor came to the site for the first time, and when he reached the goal, it may take some time. Therefore, we store information about the source of the visitor for a month. This allows you to track the source of even those visitors who were attracted by an advertising campaign, for example, a week ago, and decided to buy goods only today.
It would be interesting to hear the views and suggestions on the development of this functionality. What would you like? What is missing in the decisions of competitors? What sources of visitors would you add for automatic detection?