{"id":182128,"date":"2013-06-04T17:07:03","date_gmt":"2013-06-04T13:07:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=182128"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=182128","title":{"rendered":"<span class=\"post_title\">\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 API \u0447\u0435\u0440\u0435\u0437 Google Analytics \u043d\u0430 PHP<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/157621\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u041f\u0438\u0442\u043e\u043d.<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u0430\u043d\u043e: \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 API \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430: \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 API.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Google Analytics.<\/p>\n<p>  \u041a\u0430\u043a: \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c Google Analytics API. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u044b \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u0443\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 Google <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/other\/mobileWebsites\">\u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445<\/a>.<\/p>\n<p>  \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u0436\u043d\u043e? \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c Google Analytics \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e API \u0432 \u0442\u043e\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435?<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/1aa\/f13\/e8d\/1aaf13e8d7c06287eb4852be78f23248.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1 \u2014 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e API<\/i><\/p>\n<p>  \u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:  <\/p>\n<ul>\n<li>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 API \u0432\u043e\u043e\u0431\u0449\u0435 (\u0438\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f!),<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043c\u0430\u043b\u043e\u0439 \u043a\u0440\u043e\u0432\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u044b \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e Google Analytics API (\u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435),<\/li>\n<li>\u0435\u0434\u0438\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0438 \u0434\u043b\u044f \u0432\u0435\u0431-\u0447\u0430\u0441\u0442\u0438, \u0438 \u0434\u043b\u044f API,<\/li>\n<li>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0430\u0440\u0441\u0435\u043d\u0430\u043b Google Analytics \u2014 \u0430\u043d\u0430\u043b\u0438\u0437, \u043e\u0442\u0447\u0451\u0442\u044b, \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430\u043c.<\/li>\n<li>\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Google Analytics \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/576\/9ba\/386\/5769ba386b3f662d1a34bf510c0425b4.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 API \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/i><\/p>\n<p>  \u041c\u0438\u043d\u0443\u0441\u044b:  <\/p>\n<ul>\n<li>\u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Google Analytics \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432\u0440\u043e\u0434\u0435 \u00ab\u043a\u0430\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u00bb, \u00ab\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043b\u0438 \u043a\u0443\u043a\u0438\u00bb \u0438 \u0442.\u0434.<\/li>\n<li>\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439, \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f\u043c\u0438<\/li>\n<\/ul>\n<p>   <a name=\"habracut\"><\/a><\/p>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043c\u0438\u043d\u0443\u0441\u043e\u0432, \u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044f \u0438\u043c\u0438 \u0432\u044b\u0437\u043e\u0432 Google Analytics API, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u0430\u0448\u0435\u0433\u043e API \u043f\u043e \u0438\u0445 IP. \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 user agent \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432\u0430\u0448\u0435\u0433\u043e API \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u043d\u0430\u0434\u043e \u0438\u043c \u043f\u0440\u0435\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u0437\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8216;partner-id&#8217;.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u042f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430 Zend Framework, \u043d\u043e \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0440\u0435\u043a\u0435\u0440 \u0432 Google Analytics, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 (<i>application\/configs\/application.ini<\/i>):<\/p>\n<p>  <code>google.analytics.tracking.code = UA-44444444-44<\/code><\/p>\n<p>  \u041c\u043e\u0439 \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u00abUA\u00bb \u043d\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u2014 \u00abMO\u00bb.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432 <i>application\/Bootstrap.php<\/i> \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<pre><code class=\"php\">protected function _initPlugins() {     $front = Zend_Controller_Front::getInstance();     $front-&gt;registerPlugin(new XXX_Controller_Plugin_Integration_Google_Analytics_Mobile_Tracker); } <\/code><\/pre>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u0430\u043c \u043a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<pre><code class=\"php\">&lt;?php  class XXX_Controller_Plugin_Integration_Google_Analytics_Mobile_Tracker extends Zend_Controller_Plugin_Abstract {     const         G_VERSION = '4.4sh',         COOKIE_NAME = '__utmmobile',         COOKIE_PATH = '\/',         COOKIE_USER_PERSISTENCE =  63072000; \/\/ Two years in seconds.       public function preDispatch( Zend_Controller_Request_Abstract $request ) {         if( empty( $_SERVER['SERVER_NAME'] ) ) return;          $config = Zend_Registry::get('config');                 if( empty( $config-&gt;google-&gt;analytics-&gt;tracking-&gt;code ) ) return;                  $trackingCode = $config-&gt;google-&gt;analytics-&gt;tracking-&gt;code;         $trackingCode = 'MO' . substr( $trackingCode, 2 );              \/\/ The last octect of the IP address is removed to anonymize the user.          $utmGifLocation = &quot;http:\/\/www.google-analytics.com\/__utm.gif&quot;;          $visitorId = $this-&gt;getVisitorId($request);         \/\/ Always try and add the cookie to the response.         setrawcookie( self::COOKIE_NAME, $visitorId, time() + self::COOKIE_USER_PERSISTENCE, self::COOKIE_PATH );          \/\/ Construct the gif hit url.         $utmUrl = $utmGifLocation . &quot;?&quot; .             &quot;utmwv=&quot; . self::G_VERSION .             &quot;&utmn=&quot; . rand(0, 0x7fffffff) .             &quot;&utmhn=&quot; . urlencode($_SERVER['SERVER_NAME']) .             &quot;&utmr=&quot; . (empty($_SERVER[&quot;HTTP_REFERER&quot;]) ? '-' : urlencode($_SERVER[&quot;HTTP_REFERER&quot;])) .             &quot;&utmp=&quot; . urlencode($_SERVER[&quot;REQUEST_URI&quot;]) .             &quot;&utmac=&quot; . $trackingCode .             &quot;&utmcc=__utma%3D999.999.999.999.999.1%3B&quot; .             &quot;&utmvid=&quot; . $visitorId .             &quot;&utmip=&quot; . $this-&gt;getIP($_SERVER[&quot;REMOTE_ADDR&quot;]);          $options = array(           &quot;http&quot; =&gt; array(               &quot;method&quot; =&gt; &quot;GET&quot;           )         );                  if( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {              $options['http']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];          }         if( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) {             $options['http']['header'] = (&quot;Accept-Language: &quot; . $_SERVER['HTTP_ACCEPT_LANGUAGE']);         }          file_get_contents($utmUrl, false, stream_context_create($options));     }          protected function getIP($remoteAddress) {         if (empty($remoteAddress)) {           return '';         }         \/\/ Capture the first three octects of the IP address and replace the forth with 0, e.g. 124.455.3.123 becomes 124.455.3.0         $regex = &quot;\/^([^.]+\\.[^.]+\\.[^.]+\\.).*\/&quot;;         if (preg_match($regex, $remoteAddress, $matches)) {             return $matches[1] . '0';         }          return '';     }      protected function getVisitorId($request) {         \/\/ If there is a value in the cookie, don't change it.         if (!empty($_COOKIE[self::COOKIE_NAME])) {           return $_COOKIE[self::COOKIE_NAME];         }                  if( null != $request-&gt;getParam('partner-id') ) {             return  $request-&gt;getParam('partner-id');         }         return &quot;0x&quot; . substr( md5($_SERVER[&quot;HTTP_USER_AGENT&quot;] . uniqid(rand(0, 0x7fffffff), true)), 0, 16);     } } <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0438 \u0432\u0430\u043c.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/182128\/\"> http:\/\/habrahabr.ru\/post\/182128\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/157621\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u041f\u0438\u0442\u043e\u043d.<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u0430\u043d\u043e: \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 API \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430: \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 API.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Google Analytics.<\/p>\n<p>  \u041a\u0430\u043a: \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c Google Analytics API. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u044b \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u0443\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 Google <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/other\/mobileWebsites\">\u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445<\/a>.<\/p>\n<p>  \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u0436\u043d\u043e? \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c Google Analytics \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e API \u0432 \u0442\u043e\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435?<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/1aa\/f13\/e8d\/1aaf13e8d7c06287eb4852be78f23248.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1 \u2014 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e API<\/i><\/p>\n<p>  \u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:  <\/p>\n<ul>\n<li>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 API \u0432\u043e\u043e\u0431\u0449\u0435 (\u0438\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f!),<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043c\u0430\u043b\u043e\u0439 \u043a\u0440\u043e\u0432\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u044b \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e Google Analytics API (\u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435),<\/li>\n<li>\u0435\u0434\u0438\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0438 \u0434\u043b\u044f \u0432\u0435\u0431-\u0447\u0430\u0441\u0442\u0438, \u0438 \u0434\u043b\u044f API,<\/li>\n<li>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0430\u0440\u0441\u0435\u043d\u0430\u043b Google Analytics \u2014 \u0430\u043d\u0430\u043b\u0438\u0437, \u043e\u0442\u0447\u0451\u0442\u044b, \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430\u043c.<\/li>\n<li>\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Google Analytics \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/576\/9ba\/386\/5769ba386b3f662d1a34bf510c0425b4.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 API \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/i><\/p>\n<p>  \u041c\u0438\u043d\u0443\u0441\u044b:  <\/p>\n<ul>\n<li>\u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Google Analytics \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432\u0440\u043e\u0434\u0435 \u00ab\u043a\u0430\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u00bb, \u00ab\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043b\u0438 \u043a\u0443\u043a\u0438\u00bb \u0438 \u0442.\u0434.<\/li>\n<li>\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439, \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f\u043c\u0438<\/li>\n<\/ul>\n<p>   <\/p>\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-182128","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182128","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=182128"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182128\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}