{"id":397722,"date":"2024-06-29T13:38:10","date_gmt":"2024-06-29T13:38:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=397722"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=397722","title":{"rendered":"<span>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 GA \u0432 \u0441\u0432\u043e\u044e \u0431\u0430\u0437\u0443<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0442\u0438\u043f\u043e\u0432\u044b\u043c\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u043c\u044b \u0432\u00a0CreativePeople\u00a0\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 Google Analytics (\u0432\u0435\u0440\u0441\u0438\u044f Universal Analytics), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438 \u043d\u0430\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0440\u0430\u043d\u0435\u0435 \u0446\u0435\u043b\u0438. \u0418\u043b\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u0442\u0438\u043f\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0446\u0435\u043b\u044c.<\/p>\n<p>\u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 Google Data Studio, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 Universal Analytics \u043a Data Studio \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u0430\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u043d\u0438\u0436\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u0440\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u00a0<strong>\u0441 8 \u0430\u043f\u0440\u0435\u043b\u044f \u043f\u043e 7 \u0438\u044e\u043d\u044f<\/strong>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9eb\/da6\/61d\/9ebda661dfeaec0354417b95b7168c9b.png\" width=\"1268\" height=\"897\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9eb\/da6\/61d\/9ebda661dfeaec0354417b95b7168c9b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u2014\u00a0<strong>\u0441 9 \u043c\u0430\u0440\u0442\u0430 \u043f\u043e 7 \u0438\u044e\u043d\u044f:<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/045\/73d\/4f8\/04573d4f848b805efaee7f6389c370d4.png\" width=\"1274\" height=\"887\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/045\/73d\/4f8\/04573d4f848b805efaee7f6389c370d4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0442\u043e\u0440\u044b\u043c \u044f\u0440\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 CRM. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432 BI, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0438\u043a\u0430\u043a\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 CRM \u043f\u043e \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 BI \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0412 Google Analytics \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 90 \u0434\u043d\u0435\u0439, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u0432 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0445 \u0438\u0442\u043e\u0433\u043e\u0432.<\/p>\n<p>\u042d\u0442\u043e \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u0418\u0445 \u0447\u0438\u0441\u043b\u043e, \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c, \u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0433\u0438\u0431\u0447\u0435, \u0447\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u044b Google Analytics \u043a \u043b\u044e\u0431\u044b\u043c BI-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433<\/h3>\n<p>\u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<a href=\"https:\/\/owox.ru\/\" rel=\"noopener noreferrer nofollow\">OWOX BI<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445: \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u0435\u0430\u043d\u0441\u044b \u0438 \u0442.\u0434. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438 \u0438\u0445 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics, \u0441\u043a\u0440\u0438\u043f\u0442 GA \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0438\u044e\u00a0<a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/tasks\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0434\u0430\u043d\u0438\u0439<\/a>.<\/p>\n<p>\u0418 \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics, \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 URL.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55a\/fc6\/99b\/55afc699b4502d7ca50f0171eb046121.png\" alt=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 GA\" title=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 GA\" width=\"2157\" height=\"1403\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55a\/fc6\/99b\/55afc699b4502d7ca50f0171eb046121.png\"\/><figcaption>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 GA<\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a: \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<a href=\"https:\/\/cloud.google.com\/functions?hl=ru\" rel=\"noopener noreferrer nofollow\">Google Functions<\/a>\u00a0\u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f endpoint, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 get-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<a href=\"https:\/\/cloud.google.com\/bigquery\/streaming-data-into-bigquery?hl=ru\" rel=\"noopener noreferrer nofollow\">Streaming API<\/a>, \u043f\u0438\u0448\u0435\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 http-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0432 \u0431\u0430\u0437\u0443 Google BigQuery. \u0414\u0430\u043b\u044c\u0448\u0435 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/947\/c02\/3c2\/947c023c2b4da24a1ac9e06808d4bd21.png\" width=\"2169\" height=\"931\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/947\/c02\/3c2\/947c023c2b4da24a1ac9e06808d4bd21.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a BI:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bc4\/acd\/8b7\/bc4acd8b75f77b663cb09c63a48a65b4.png\" width=\"1362\" height=\"926\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bc4\/acd\/8b7\/bc4acd8b75f77b663cb09c63a48a65b4.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 GTM<\/h3>\n<p>\u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432\u00a0customTask (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 customTask \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u0433\u0430\u0439\u0434\u0435 Simo Ahava<\/a>). \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">var custom_tracking_url = 'https:\/\/{\u0430\u0434\u0440\u0435\u0441 \u0433\u0443\u0433\u043b\u0444\u0443\u043a\u043d\u0446\u0438\u0438 \u0434\u043b\u044f endpoint}', \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 GA.  \/\/ \u0418\u0441\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 GA \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f model hitPayLoad = '?' + model.get('hitPayload'), \/\/ \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e user agent user_agent = '&amp;us_ag='+ encodeURIComponent(navigator.userAgent), \/\/ \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0440\u0435\u0444\u0435\u0440\u0435\u0440\u0440\u0435 referrer = '&amp;ref='+encodeURIComponent(document.referrer), \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043e\u043a\u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f window_dimensions = '&amp;wdm='+encodeURIComponent({{User window width}}+'x'+{{User window height}});  \/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 url \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c. var final_url = custom_tracking_url + hitPayLoad + user_agent + referrer + window_dimensions; var xhr = new XMLHttpRequest(); xhr.open('GET', final_url, true); xhr.send();<\/code><\/pre>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430, \u043f\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 customTask. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 customTask \u043f\u0443\u0448 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 dataLayer \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u0443\u0448 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 GTM \u0438 \u0442\u0435\u0433, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0430\u0448\u0443 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u043e\u0447\u043a\u0438 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Functions<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/reference\/libraries?hl=ru\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Google<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0435\u0442 \u043e\u0431\u0432\u0435\u0441 \u0434\u043b\u044f CORS, \u0442\u043e \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def stream_bq(uri, headers_json_string):      client = bigquery.Client()     table = client.get_table(f\"\"\"{PROJECT}.{DATASET}.{TABLE}\"\"\")     content = [{'URL': uri,                 'timestamp': datetime.datetime.now(),                 'headers': headers_json_string                 }]      errors = client.insert_rows(table, content)      print(f\"added {content}\")      if errors:         logging.error(errors)<\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">from google.cloud import bigquery import datetime import logging import urllib.parse import datetime import json import re  PROJECT = 'cpeople-analytics' DATASET = 'import_ga' TABLE = 'streaming_' + datetime.datetime.today().strftime(\"%Y%m%d\")   def stream_bq(uri, headers_json_string):      client = bigquery.Client()     table = client.get_table(f\"\"\"{PROJECT}.{DATASET}.{TABLE}\"\"\")     content = [{'URL': uri,                 'timestamp': datetime.datetime.now(),                 'headers': headers_json_string                 }]      errors = client.insert_rows(table, content)      print(f\"added {content}\")      if errors:         logging.error(errors)   def entry_point(request):     request_host = request.headers[\"Origin\"]     patterns = [r'.+\\.cpeople.ru',                 r'.+\\.devw.cpeople.ru',                 r'.+\\.devh.cpeople.ru']     matches = [re.match(p, request_host) is not None for p in patterns]      origin = 'https:\/\/cpeople.ru'     if any(matches):         origin = request.headers[\"Origin\"]      # Set CORS headers for the preflight request     if request.method == 'OPTIONS':         # Allows GET requests from any origin with the Content-Type         # header and caches preflight response for an 3600s          headers = {             'Access-Control-Allow-Origin': origin,             'Access-Control-Allow-Methods': 'GET',             'Access-Control-Allow-Headers': 'Content-Type',             'Access-Control-Max-Age': '3600'         }          return ('', 204, headers)      # Set CORS headers for the main request     headers = {         'Access-Control-Allow-Origin': origin     }      request_headers_dictionary = {k: v for k, v in request.headers.items()}      if request.url:         stream_bq(request.url, json.dumps(request_headers_dictionary))      return (\"Ok\", 200, headers)<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u0440\u044c, \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0443\u0436\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 BigQuery<\/h3>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043e\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0439 \u0440\u0430\u0437 \u0432 \u0441\u0443\u0442\u043a\u0438. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043d\u043e \u043e\u043f\u0438\u0448\u0435\u043c \u0435\u0435 \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>1) \u0414\u043b\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"sql\">CREATE TEMP FUNCTION urldecode(url STRING) AS ((   SELECT STRING_AGG(     IF(REGEXP_CONTAINS(y, r'^%[0-9a-fA-F]{2}'),        SAFE_CONVERT_BYTES_TO_STRING(FROM_HEX(REPLACE(y, '%', ''))), y), ''      ORDER BY i     )   FROM UNNEST(REGEXP_EXTRACT_ALL(url, r\"%[0-9a-fA-F]{2}(?:%[0-9a-fA-F]{2})*|[^%]+\")) y   WITH OFFSET AS i  ));<\/code><\/pre>\n<p>2) \u0414\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"sql\"># \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. CREATE TEMP FUNCTION get_value(name STRING, url STRING) AS (     urldecode(REGEXP_EXTRACT(url, r'[&amp;\\?]'||name||'=([^&amp;]+)')) );<\/code><\/pre>\n<p>3) \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"sql\"># \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c URL \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. SELECT       PARSE_DATE(\"%Y%m%d\", _TABLE_SUFFIX) as date,      timestamp,      get_value('cid', URL) clientId,     get_value('gtm', URL) google_tag_manager_container_id,     get_value('ni', URL) non_interaction,     get_value('t', URL) type,      STRUCT( REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-Country'), '\"', \"\" ) as country, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-Citylatlong'), '\"', \"\" ) as location, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-User-Ip'), '\"', \"\" ) as ip, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-City'), '\"', \"\" ) as city     ) geo,      ARRAY( SELECT AS STRUCT       REGEXP_EXTRACT(dimension, r'(cd\\d+)') number,     urldecode(REGEXP_EXTRACT(dimension, r'cd\\d+=(.+)$')) value FROM UNNEST(REGEXP_EXTRACT_ALL(URL, r'[&amp;\\?](cd\\d+=[^&amp;]+)')) dimension     ) dimensions,      STRUCT ( get_value('dt', URL) as title, get_value('dl', URL) as url, get_value('ref', URL) as referrer, get_value('dr', URL) as external_referrer     ) document,     ... FROM `cpeople-analytics.import_ga.streaming_*` WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE(\"%Y%m%d\", date_start) and FORMAT_DATE(\"%Y%m%d\", date_end)<\/code><\/pre>\n<p>4) \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u043d\u0438\u043c \u0432 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044f userAgent \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0<a href=\"https:\/\/github.com\/woothee\/woothee-js\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/woothee\/woothee-js<\/a><\/p>\n<pre><code class=\"sql\">CREATE TEMPORARY FUNCTION decode_user_agent(ua STRING)  RETURNS STRING  LANGUAGE js AS \"\"\"  return JSON.stringify(woothee.parse(ua)); \"\"\"OPTIONS(library=\"gs:\/\/model_hit_data\/woothee.js\");<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"json\">{   \"name\":\"Chrome\",   \"vendor\":\"Google\",   \"version\":\"91.0.4469.0\",   \"category\":\"smartphone\",   \"os\":\"Android\",   \"os_version\":\"10\" }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0442 \u0432 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435, \u043d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0438\u043c\u0435\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044e: \u043d\u043e\u0432\u0438\u0437\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043f\u043ec\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<blockquote>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0432 Google Analytics, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 CRM \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<\/blockquote>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438\u0437 GA. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b\u00a0\u043d\u0430\u00a0\u0441\u0430\u0439\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f \u0432\u0441\u0435\u00a0\u0435\u0449\u0435\u00a0\u0431\u0443\u0434\u0443\u0442\u00a0\u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b\u00a0\u043a\u0430\u043a\u00a0\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u00a0\u043d\u043e\u0432\u043e\u0433\u043e\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043d\u043e\u0432\u0438\u0437\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"sql\">SELECT      DISTINCT date, clientId,    # \u0415\u0441\u043b\u0438 \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0438\u043b\u0438 \u0432 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0434\u0430\u0442\u0430\u0445,   # \u0442\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u0430\u043a \u0432\u0435\u0440\u043d\u0443\u0432\u0448\u0435\u0433\u043e\u0441\u044f new_user = false.   if(new_user_history and new_user_streaming, true, false) new_user FROM      (SELECT             date, clientId,       # \u0418\u0449\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e clientId:       (           SELECT if(count(m.date) > 0, false, true)           FROM cpeople-analytics.import_ga.modelled_hit_data m           WHERE m.clientId = r.clientId            # \u0431\u0435\u0440\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.           and (m.date between DATE_SUB(r.date, INTERVAL days_user_status_retrospective DAY) and DATE_SUB(r.date, INTERVAL 1 DAY))           # \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043a\u0443\u0441\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0431\u044b\u043b \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d, \u0442\u043e \u043c\u044b \u043d\u0435 \u0431\u0440\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438           and (m.date not between date_start and date_end)       ) new_user_history,       # \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u0443\u0441\u043a\u0430 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0437\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u0434\u043d\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u0431\u044b\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u0432\u0430\u0442\u0435\u043b\u0435, \u0442\u043e       # \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043e\u043d \u0443\u0436\u0435 \u0441\u0442\u0430\u043b \u0432\u0435\u0440\u043d\u0443\u0432\u0448\u0438\u043c\u0441\u044f.   if(FIRST_VALUE(r.date) OVER(PARTITION BY r.clientId ORDER BY date asc) != r.date, false, true) new_user_streaming   FROM raw_streaming r<\/code><\/pre>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043c\u044b \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 Google Analytics \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Reports API, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/556\/42b\/478\/55642b478ed78e34c8ab2d907c848ae1.png\" width=\"1371\" height=\"933\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/556\/42b\/478\/55642b478ed78e34c8ab2d907c848ae1.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0439 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430.<\/p>\n<h3>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Analytics<\/h3>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u041e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0438\u0434\u0438\u043c \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c \u043c\u0435\u0436\u0434\u0443 Google Analytics \u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430.<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/564\/a8c\/60e\/564a8c60e5f23fa59174d8e34d639b9c.jpg\" width=\"1618\" height=\"953\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/564\/a8c\/60e\/564a8c60e5f23fa59174d8e34d639b9c.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e24\/b49\/64c\/e24b4964c3aeba6a0a6f1fdfa7ae6701.png\" width=\"1711\" height=\"1116\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e24\/b49\/64c\/e24b4964c3aeba6a0a6f1fdfa7ae6701.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics 4<\/h3>\n<p>\u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 GA \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 BigQuery. \u041d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044f \u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0432\u0441\u0435 \u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Google Analytics 4.<\/p>\n<p>\u0421\u0432\u044f\u0437\u0430\u043d\u043e \u044d\u0442\u043e \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u00a0<a href=\"https:\/\/support.google.com\/analytics\/answer\/9267744?hl=ru\" rel=\"noopener noreferrer nofollow\">\u043b\u0438\u043c\u0438\u0442\u044b Google Analytics 4<\/a><\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0431\u044b\u043b\u0438 \u043d\u0438\u043a\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 Google Analytics \u043f\u043e \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0434\u043b\u044f realtime \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u0435\u043d \u043f\u0443\u043d\u043a\u0442 3, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u043e\u0447\u043a\u0435 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0448\u043b\u0430 \u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 Google Analytics, \u0438\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b GET-\u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u0438\u043b\u0443 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0430\u043c\u043e\u0439 GA4, \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u043c\u0438, \u0447\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ca8\/b84\/b1b\/ca8b84b1ba1ceff23f465be029c44968.png\" width=\"2115\" height=\"597\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ca8\/b84\/b1b\/ca8b84b1ba1ceff23f465be029c44968.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430, \u0437\u0430\u0448\u0438\u0442\u0430\u044f \u0432 customTask, \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Google Analytics, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 Universal Analytics \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0432\u043e\u0434\u044f\u0442 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445: \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043e\u0441 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c Google Analytics, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e clientId, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0432\u044b\u0439, \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;everything_blocked&#187;.<\/p>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0438\u0437 customTask \u0432\u0435\u0440\u0441\u0438\u0438 Universal \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0432 GA4, \u043d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u0440\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e cookies \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 localStorage, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e ID \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, IP \u0438 \u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0444\u0430\u043a\u0442\u0443\u043c \u043f\u0440\u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0447\u0442\u043e \u0434\u0430\u0441\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0435\u0437 clientId.<\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0435\u0440\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Google Analytics \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/592029\/\"> https:\/\/habr.com\/ru\/articles\/592029\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 GA \u0432 \u0441\u0432\u043e\u044e \u0431\u0430\u0437\u0443<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0442\u0438\u043f\u043e\u0432\u044b\u043c\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u043c\u044b \u0432\u00a0CreativePeople\u00a0\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 Google Analytics (\u0432\u0435\u0440\u0441\u0438\u044f Universal Analytics), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438 \u043d\u0430\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0440\u0430\u043d\u0435\u0435 \u0446\u0435\u043b\u0438. \u0418\u043b\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u0442\u0438\u043f\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0446\u0435\u043b\u044c.<\/p>\n<p>\u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 Google Data Studio, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 Universal Analytics \u043a Data Studio \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u0430\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u043d\u0438\u0436\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u0440\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u00a0<strong>\u0441 8 \u0430\u043f\u0440\u0435\u043b\u044f \u043f\u043e 7 \u0438\u044e\u043d\u044f<\/strong>:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u2014\u00a0<strong>\u0441 9 \u043c\u0430\u0440\u0442\u0430 \u043f\u043e 7 \u0438\u044e\u043d\u044f:<\/strong><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0442\u043e\u0440\u044b\u043c \u044f\u0440\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 CRM. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432 BI, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0438\u043a\u0430\u043a\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 CRM \u043f\u043e \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 BI \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0412 Google Analytics \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 90 \u0434\u043d\u0435\u0439, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u0432 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0445 \u0438\u0442\u043e\u0433\u043e\u0432.<\/p>\n<p>\u042d\u0442\u043e \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u0418\u0445 \u0447\u0438\u0441\u043b\u043e, \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c, \u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0433\u0438\u0431\u0447\u0435, \u0447\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u044b Google Analytics \u043a \u043b\u044e\u0431\u044b\u043c BI-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433<\/h3>\n<p>\u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<a href=\"https:\/\/owox.ru\/\" rel=\"noopener noreferrer nofollow\">OWOX BI<\/a>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445: \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0441\u0435\u0430\u043d\u0441\u044b \u0438 \u0442.\u0434. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438 \u0438\u0445 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics, \u0441\u043a\u0440\u0438\u043f\u0442 GA \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0438\u044e\u00a0<a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/tasks\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0434\u0430\u043d\u0438\u0439<\/a>.<\/p>\n<p>\u0418 \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Google Analytics, \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 URL.<\/p>\n<figure class=\"full-width\"><figcaption>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0442\u043e\u0447\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 GA<\/figcaption><\/figure>\n<p>\u041c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a: \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<a href=\"https:\/\/cloud.google.com\/functions?hl=ru\" rel=\"noopener noreferrer nofollow\">Google Functions<\/a>\u00a0\u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f endpoint, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 get-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<a href=\"https:\/\/cloud.google.com\/bigquery\/streaming-data-into-bigquery?hl=ru\" rel=\"noopener noreferrer nofollow\">Streaming API<\/a>, \u043f\u0438\u0448\u0435\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 http-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0432 \u0431\u0430\u0437\u0443 Google BigQuery. \u0414\u0430\u043b\u044c\u0448\u0435 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a BI:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 GTM<\/h3>\n<p>\u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432\u00a0customTask (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 customTask \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"https:\/\/www.simoahava.com\/analytics\/customtask-the-guide\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u0433\u0430\u0439\u0434\u0435 Simo Ahava<\/a>). \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">var custom_tracking_url = 'https:\/\/{\u0430\u0434\u0440\u0435\u0441 \u0433\u0443\u0433\u043b\u0444\u0443\u043a\u043d\u0446\u0438\u0438 \u0434\u043b\u044f endpoint}', \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 GA.  \/\/ \u0418\u0441\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 GA \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f model hitPayLoad = '?' + model.get('hitPayload'), \/\/ \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e user agent user_agent = '&amp;us_ag='+ encodeURIComponent(navigator.userAgent), \/\/ \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0440\u0435\u0444\u0435\u0440\u0435\u0440\u0440\u0435 referrer = '&amp;ref='+encodeURIComponent(document.referrer), \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043e\u043a\u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f window_dimensions = '&amp;wdm='+encodeURIComponent({{User window width}}+'x'+{{User window height}});  \/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 url \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c. var final_url = custom_tracking_url + hitPayLoad + user_agent + referrer + window_dimensions; var xhr = new XMLHttpRequest(); xhr.open('GET', final_url, true); xhr.send();<\/code><\/pre>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430, \u043f\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 customTask. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 customTask \u043f\u0443\u0448 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 dataLayer \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u0443\u0448 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 GTM \u0438 \u0442\u0435\u0433, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0430\u0448\u0443 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u043e\u0447\u043a\u0438 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Functions<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/reference\/libraries?hl=ru\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Google<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0435\u0442 \u043e\u0431\u0432\u0435\u0441 \u0434\u043b\u044f CORS, \u0442\u043e \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def stream_bq(uri, headers_json_string):      client = bigquery.Client()     table = client.get_table(f\"\"\"{PROJECT}.{DATASET}.{TABLE}\"\"\")     content = [{'URL': uri,                 'timestamp': datetime.datetime.now(),                 'headers': headers_json_string                 }]      errors = client.insert_rows(table, content)      print(f\"added {content}\")      if errors:         logging.error(errors)<\/code><\/pre>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">from google.cloud import bigquery import datetime import logging import urllib.parse import datetime import json import re  PROJECT = 'cpeople-analytics' DATASET = 'import_ga' TABLE = 'streaming_' + datetime.datetime.today().strftime(\"%Y%m%d\")   def stream_bq(uri, headers_json_string):      client = bigquery.Client()     table = client.get_table(f\"\"\"{PROJECT}.{DATASET}.{TABLE}\"\"\")     content = [{'URL': uri,                 'timestamp': datetime.datetime.now(),                 'headers': headers_json_string                 }]      errors = client.insert_rows(table, content)      print(f\"added {content}\")      if errors:         logging.error(errors)   def entry_point(request):     request_host = request.headers[\"Origin\"]     patterns = [r'.+\\.cpeople.ru',                 r'.+\\.devw.cpeople.ru',                 r'.+\\.devh.cpeople.ru']     matches = [re.match(p, request_host) is not None for p in patterns]      origin = 'https:\/\/cpeople.ru'     if any(matches):         origin = request.headers[\"Origin\"]      # Set CORS headers for the preflight request     if request.method == 'OPTIONS':         # Allows GET requests from any origin with the Content-Type         # header and caches preflight response for an 3600s          headers = {             'Access-Control-Allow-Origin': origin,             'Access-Control-Allow-Methods': 'GET',             'Access-Control-Allow-Headers': 'Content-Type',             'Access-Control-Max-Age': '3600'         }          return ('', 204, headers)      # Set CORS headers for the main request     headers = {         'Access-Control-Allow-Origin': origin     }      request_headers_dictionary = {k: v for k, v in request.headers.items()}      if request.url:         stream_bq(request.url, json.dumps(request_headers_dictionary))      return (\"Ok\", 200, headers)<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u0435\u0440\u044c, \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0443\u0436\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 BigQuery<\/h3>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043e\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0439 \u0440\u0430\u0437 \u0432 \u0441\u0443\u0442\u043a\u0438. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043d\u043e \u043e\u043f\u0438\u0448\u0435\u043c \u0435\u0435 \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>1) \u0414\u043b\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"sql\">CREATE TEMP FUNCTION urldecode(url STRING) AS ((   SELECT STRING_AGG(     IF(REGEXP_CONTAINS(y, r'^%[0-9a-fA-F]{2}'),        SAFE_CONVERT_BYTES_TO_STRING(FROM_HEX(REPLACE(y, '%', ''))), y), ''      ORDER BY i     )   FROM UNNEST(REGEXP_EXTRACT_ALL(url, r\"%[0-9a-fA-F]{2}(?:%[0-9a-fA-F]{2})*|[^%]+\")) y   WITH OFFSET AS i  ));<\/code><\/pre>\n<p>2) \u0414\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"sql\"># \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. CREATE TEMP FUNCTION get_value(name STRING, url STRING) AS (     urldecode(REGEXP_EXTRACT(url, r'[&amp;\\?]'||name||'=([^&amp;]+)')) );<\/code><\/pre>\n<p>3) \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"sql\"># \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c URL \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. SELECT       PARSE_DATE(\"%Y%m%d\", _TABLE_SUFFIX) as date,      timestamp,      get_value('cid', URL) clientId,     get_value('gtm', URL) google_tag_manager_container_id,     get_value('ni', URL) non_interaction,     get_value('t', URL) type,      STRUCT( REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-Country'), '\"', \"\" ) as country, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-Citylatlong'), '\"', \"\" ) as location, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-User-Ip'), '\"', \"\" ) as ip, REGEXP_REPLACE( JSON_QUERY(headers, '$.X-Appengine-City'), '\"', \"\" ) as city     ) geo,      ARRAY( SELECT AS STRUCT       REGEXP_EXTRACT(dimension, r'(cd\\d+)') number,     urldecode(REGEXP_EXTRACT(dimension, r'cd\\d+=(.+)$')) value FROM UNNEST(REGEXP_EXTRACT_ALL(URL, r'[&amp;\\?](cd\\d+=[^&amp;]+)')) dimension     ) dimensions,      STRUCT ( get_value('dt', URL) as title, get_value('dl', URL) as url, get_value('ref', URL) as referrer, get_value('dr', URL) as external_referrer     ) document,     ... FROM `cpeople-analytics.import_ga.streaming_*` WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE(\"%Y%m%d\", date_start) and FORMAT_DATE(\"%Y%m%d\", date_end)<\/code><\/pre>\n<p>4) \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u043d\u0438\u043c \u0432 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044f userAgent \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0<a href=\"https:\/\/github.com\/woothee\/woothee-js\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/woothee\/woothee-js<\/a><\/p>\n<pre><code class=\"sql\">CREATE TEMPORARY FUNCTION decode_user_agent(ua STRING)  RETURNS STRING  LANGUAGE js AS \"\"\"  return JSON.stringify(woothee.parse(ua)); \"\"\"OPTIONS(library=\"gs:\/\/model_hit_data\/woothee.js\");<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"json\">{   \"name\":\"Chrome\",   \"vendor\":\"Google\",   \"version\":\"91.0.4469.0\",   \"category\":\"smartphone\",   \"os\":\"Android\",   \"os_version\":\"10\" }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0442 \u0432 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435, \u043d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0438\u043c\u0435\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044e: \u043d\u043e\u0432\u0438\u0437\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043f\u043ec\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<blockquote>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0432 Google<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-397722","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/397722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397722"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/397722\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}