📜 ⬆️ ⬇️

Integration of offline statistics with Google Analytics

image The task is to obtain accurate data about the sources of conversions in the online store in order to have an idea about the real returns from different advertising channels and their interaction:


Problems online statistics

Everyone knows the problems of online statistics, so I’ll go straight to the point - even if the best data collection systems do not allow for offline conversion. As long as the user performs some actions online, we all know about him, but as soon as it comes to the phone, our meters immediately lose sight of him. In various areas of online trading, communication with the seller by phone plays a different role, but in our case it is important. Immediately, I’ll make a reservation that this is an online store of ceramic tiles, where, in principle, it’s difficult to sell online, because the buyer needs direct visual and tactile contact with the product and consultation of the seller. Therefore, in our case, accounting for offline conversions is a necessity. For these purposes, we have developed our own accounting system, the Chameleon. The principle of its operation is not new; a fairly large number of similar tools and systems are already on the market. We want to tell only about how to synchronize the data collected from oneself with the data from Google Analytics (GA) and, in fact, what it is generally needed for.
And for the beginning it is necessary to consider the second part of the problems, namely, the problems associated with the collection and processing of data on offline conversions. First, you need to tell what tracking methods are:
Substitution phone number

For each traffic source has its own number. The method has its limitations and disadvantages:

Discount Coupons

When a visitor is offered to print a certain coupon with a number for receiving a discount, here:

Distribute ID to each user

When every visitor who comes to the site receives his ID and sees it either near the phone number or near the product, the problems are:

There are still some ways to count visitors, but they are either not accurate, or they are interpretations of the above methods, so I’ll focus on the main three.
Chameleon offline conversion accounting system

image We, ultimately, chose the latter method of accounting, because in our case, he came up more, called Chameleon’s own system and taught him the following simple actions:

I will describe in the next article, of course, if this will be of interest to anyone, about how such a system is built in general and what problems we have encountered.
And then it turned out the following - for all three methods (with a substitution, coupons or ID) there is a general heap of problems that greatly hinder adequate evaluation of advertising costs and introduce a high degree of error in the accuracy of the data.
Here are some of them:

Agree, it is enough to spoil all the statistics collected ...
Therefore, we decided to find some way to track the user, which would allow us to answer all the above questions, the method of obtaining complete statistics about our customers. Since we are a small company with only 6 employees, we cannot afford the development of a large statistics system like GA or Liveinternet. In addition, we would not want to burden ourselves with storing huge amounts of statistical data that we could get. Yes, and rebuilding the bike is also not the best way, so we decided to choose and use someone else's experience in the field of statistics and integrate them with our Chameleon. GA was chosen for this purpose.
Integration: Chameleon & Google Analytics

Next we only needed to take the basic data transfer method, and here we made a mistake, instead of using the custom variables _trackPageview , we took account of the _trackEvent events. Although this method is similar, it has one very important difference - it creates an event, i.e. if the user enters the site and we record an event, then GA will consider it as a transition within the site, which will not be a failure. After clarifying this feature, we changed the approach and started transferring data to GA using user variables via _trackPageview .
To do this, in the GA code itself (standard tracking) before pageTracker._trackPageview (); we prescribe the formation of a variable:
pageTracker._setCustomVar(1, 'id', '3456', 2);
pageTracker._trackPageview();

For asynchronous tracking code:
_gaq.push(['_ setCustomVar', 1, 'id', '3456', 2]);
_gaq.push(['_trackPageview']);

The specification of this method:
_setCustomVar(index, name, value, opt_scope)
Options

Int index - The position used for the user variable. Possible values: 1-5, inclusive.
String name - The name of the user variable.
String value - The value of the user variable.
Int opt_scope - The scope used for the user variable. Possible values ​​are 1 for the visitor level, 2 for the session level, and 3 for the page level.
Result

Thus, Chameleon, we give out all users a unique ID, write it in a cookie and send it to Google Analytics. And at the end of each month we get a table with purchases on our website with a list of each customer's ID and go to analyze their behavior in Analytics. There we can:

Here's how it looks on the screen with us:
These are the paths through the site of a specific customer, we have created a segment that includes the user only with a specific ID. By the way, you can take all the IDs of all buyers for a certain period and compare their behavior with the behavior of other visitors.
So, he visited our site three times from 17/11/2010 to 11/20/2010, looked through only 6 pages and spent 5 and a half minutes on the site.
image
He's from Moscow.
image
He came to us on November 18 and 19.
image
And I found our site in Yandex on request - “tile sancy beige”.
image
And here are the four pages he viewed, as per the textbook - product card, contacts, delivery and payment methods.
image

')

Source: https://habr.com/ru/post/109383/


All Articles