Отбор посетителей из Google Analytics в реальном времени

У меня много сайтов, и я хочу создать панель мониторинга, показывающую количество посетителей в режиме реального времени на каждом из них на одной странице. (кто-нибудь еще захочет этого?) Сейчас единственный способ просмотреть эту информацию - это открыть новую вкладку для каждого сайта.

У Google нет API в реальном времени, поэтому я задаюсь вопросом, возможно ли очистить эти данные. Эдуардо Черето узнал, что Google передает данные в режиме реального времени по запросу сети в режиме реального времени / привязки. Кто-нибудь более подкованный имеет представление о том, как мне начать? Вот что я думаю:

Figure out how to authenticate programmatically

Inspect all of the realtime/bind requests to see how they change. Does each request have a unique key? Where does that come from? Below is my breakdown of the request:

https://www.google.com/analytics/realtime/bind?VER=8

&key=[What is this? Where does it come from? 21 character lowercase alphanumeric, stays the same each request]

&ds=[What is this? Where does it come from? 21 character lowercase alphanumeric, stays the same each request]

&pageId=rt-standard%2Frt-overview

&q=t%3A0%7C%3A1%3A0%3A%2Ct%3A11%7C%3A1%3A5%3A%2Cot%3A0%3A0%3A4%2Cot%3A0%3A0%3A3%2Ct%3A7%7C%3A1%3A10%3A6%3D%3DREFERRAL%3B%2Ct%3A10%7C%3A1%3A10%3A%2Ct%3A18%7C%3A1%3A10%3A%2Ct%3A4%7C5%7C2%7C%3A1%3A10%3A2!%3Dzz%3B%2C&f

The q variable URI decodes to this (what the?): t:0|:1:0:,t:11|:1:5:,ot:0:0:4,ot:0:0:3,t:7|:1:10:6==REFERRAL;,t:10|:1:10:,t:18|:1:10:,t:4|5|2|:1:10:2!=zz;,&f

&RID=rpc

&SID=[What is this? Where does it come from? 16 character uppercase alphanumeric, stays the same each request]

&CI=0

&AID=[What is this? Where does it come from? integer, starts at 1, increments weirdly to 150 and then 298]

&TYPE=xmlhttp

&zx=[What is this? Where does it come from? 12 character lowercase alphanumeric, changes each request]

&t=1

Inspect all of the realtime/bind responses to see how they change. How does the data come in? It looks like some altered JSON. How many times do I need to connect to get the data? Where is the active visitors on site number in there? Here is a dump of sample data:

19 [[151,["noop"] ] ] 388 [[152,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[49,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[0,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3,2,0],"name":"Total"}]}}]]] ] 388 [[153,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[52,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[2,1,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3,2],"name":"Total"}]}}]]] ] 388 [[154,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[53,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[0,3,1,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3],"name":"Total"}]}}]]] ]

Дайте мне знать, если вы можете помочь с любым из пунктов выше!

enter image description here

Ответы на вопрос(4)

Ваш ответ на вопрос