It would seem that installing and configuring the Google Analytics counter is a simple task. In fact, this "simplicity" hides a lot of pitfalls. We are constantly confronted with subtleties, unobvious peculiarities of counting, and deeply hidden errors (of course, we are usually to blame ourselves :).
Based on our experience, I formulated 10 tips that will be useful to most Analytics users - once it was our rake! Some topics deserve separate articles, but for now I’ll talk about more or less obvious and simple technical tricks.
Check regular expressions when setting targets')
Quite often, when specifying the target address, you have to use regular expressions: for example, if the address fragment you are looking for is surrounded by other parts. Regular expressions are subtle matter, but I don’t want to wait for the update to check the spelling. You can check the correctness of an expression instantly by going to the “Content - Most Popular Content” section and entering an expression in the filter field. The content is immediately filtered, and you can make sure that the code is correct.
Setting user variablesGoogle Analytics allows users to mark additional variables for segmentation. With their help, you can select the analytics categories of users and compare the behavior of different segments. Most often, this functionality is used to separate anonymous users from those registered on the site - a comparative analysis of these two categories of visitors usually leads to useful conclusions. More about using custom variables in a
post on Habré .
Fussing around redirectsRedirects are found on sites more often than it seems: it is a redirection to the domain name "without www", and regional selectors. Not everyone knows that different types of redirects transmit information about the referrer (transition source) in different ways: this can lead to the fact that information about traffic sources will be incorrect.
The only type of redirect that stores information about the source of transition is server redirect with the code 301 (Moved Permanently). It is necessary to bear this in mind and try to carry out the redirection in this way. Using a redirect with code 301 is also useful for search engine optimization and is generally a “good tone”.
Site ScanInstalling Google Analytics code in most modern CMS comes down to writing code in a universal page template, and there are special modules in specially advanced CMS. However, there are cases when there is no confidence in the full “coverage” of the site (for example, if there are several page templates). The
sitescanga.com service can help
here . Although its free edition allows you to scan only 100 pages of the site, this information usually reveals problems with the placement of the code.
Browser ScriptsIn the convenient interface of Analytics there are trifles, imperceptible at first, but annoying with the constant use of the system. Firefox users can use the
useful Better Google Analytics extension , which fixes a few issues and adds useful functionality.
Google Chrome users can use the scripts that make up this extension by installing them separately (there are links on the extension page).
Clearing excess dataGoogle Analytics report data is often distorted due to the fact that visits by administrators, moderators, and other members of the site team are taken into account. It is usually recommended to exclude this data from the report by filtering by IP addresses, however, it is often better to modify the site so that the counter is not displayed for users logged on to the site as administrators. For example,
the Google Analytics extension for Drupal can only show the counter to users with certain roles.
Adding search enginesMany people know that Google Analytics does not recognize conversions from many Russian search engines (except for Yandex). In order for visitors from other systems to correctly calculate the counter, you need to add their addresses to the code (
my colleague Timofey Putintsev writes more about this
in his blog ). Daniil Azovskikh investigated the work of the code and added a clarification: if the search engine is located on a subdomain of another search engine (for example, blogs.yandex.ru),
it must be specified first or set an additional priority flag .
Comparative chartsGoogle Analytics may display data in different ways. Usually everyone uses a tabular view, but others are often very useful. Evaluate, for example, how convenient it is to compare performance indicators in the “Comparison” mode.
!

Form Fill CheckGoogle Analytics allows you to track any events available in JavaScript. This can be used in non-trivial ways: for example, to track the occupancy of large questionnaires. By installing an onBlur event handler for each field of the questionnaire, sending a message to Analytics (as usual: onBlur = “pageTracker._trackPageview ('/ reg_form / step2')”), you can get statistics on how many users filled each field. If a “step” is formed - one should pay attention to that field, after which the fillings become less.
Errors and lapses when installing the counterIt's amazing how many opportunities for errors exist in simple Analytics code! My "favorite": extra spaces in the identifier, using functions from synchronous code after loading asynchronous (these are the most nasty errors: cookies are set correctly, Analytics does not see installation errors, and transitions are not considered). And here is a
list of rakes from Timothy Putintsev .
In fact, the experience has accumulated more. than 10 points. So wait for the continuation in the next series :) Well, at the
master class , of course, I think we will have a lot to tell in 7 hours.
Payalnik