Cov txheej txheem:

Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard: 6 Cov Kauj Ruam
Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard: 6 Cov Kauj Ruam

Video: Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard: 6 Cov Kauj Ruam

Video: Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard: 6 Cov Kauj Ruam
Video: Python! Emojis 2024, Hlis ntuj nqeg
Anonim
Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard
Kwj Cov Ntaub Ntawv Los Ntawm Google Cov Ntawv rau Dashboard

Spreadsheets ua tau zoo ntawm kev siv cov ntaub ntawv tab sis tsis pom nws. Qhov no yog vim li cas thiaj li muaj ntau qhov tshwj xeeb pom cov ntaub ntawv thiab BI dashboard cov tuam txhab pib tawm tuaj. Qhov teeb meem nrog feem ntau ntawm cov khoom no yog tias lawv feem ntau kim thiab nyuaj rau teeb tsa. Phau ntawv qhia no yuav qhia koj txoj hauv kev yooj yim, pheej yig los tsim kom zoo nkauj, sib luag, hloov kho lub sijhawm tiag tiag los ntawm koj li Google Cov Ntawv.

Khoom siv

  • Google Ntawv: Cov ntawv nthuav qhia muaj zog koj tuaj yeem siv hauv koj lub vev xaib (dawb).
  • Thawj Lub Xeev: Cov ntaub ntawv tshaj tawm thiab pom kev pabcuam uas koj tuaj yeem siv los tsim lub sijhawm tiag tiag hauv koj lub vev xaib (pub dawb rau cov tub ntxhais kawm, $ 9.99/mo lossis $ 99/xyoo rau txhua tus neeg ntxiv).

Kauj Ruam 1: Nws Ua Haujlwm Li Cas

Thawj Lub Xeev yog cov ntaub ntawv tshaj tawm cov kev pabcuam, uas txhais tau tias koj tuaj yeem thawb cov sijhawm ua cov ntaub ntawv (piv txwv li cov ntaub ntawv nrog lub sijhawm) rau nws API. Hauv lwm lo lus, yog Qhov Kub 50 degrees ntawm 5:45 teev tsaus ntuj, peb tuaj yeem xa cov ntaub ntawv ntawd yooj yim raws li cov ntaub ntawv taw qhia rau Thawj Lub Xeev API. Thaum cov ntaub ntawv ntawd nyob hauv koj tus as khauj, koj tuaj yeem tso tawm cov ntaub ntawv ntawd hauv kev pom thiab tsim cov ntaub ntawv kev cai uas koj tuaj yeem pom hauv koj lub vev xaib. Koj tsuas yog yuav tsum tau txais Google Cov Ntawv xa cov ntaub ntawv los ntawm koj daim ntawv teev npe mus rau koj Tus Thawj Xeev tus lej nyiaj thaum koj xav kom nws xa.

Google Cov Ntawv muaj qhov ua kom zoo txaus sau uas peb tuaj yeem siv los tsim txoj haujlwm tshwj xeeb kom ua li ntawd. Peb tsuas yog yuav tsum ua haujlwm hauv Google Script uas yuav xa cov ntaub ntawv mus rau Initial State API. Kev hu qhov haujlwm ntawd hauv koj daim ntawv teev npe yuav yooj yim thiab cia koj xa cov ntaub ntawv twg los xij peb xav tau

Kauj Ruam 2: Tsim Thawj Lub Xeev Cov Ntaub Ntawv Thoob

Tsim Thawj Lub Xeev Cov Ntaub Ntawv Thoob
Tsim Thawj Lub Xeev Cov Ntaub Ntawv Thoob

Sau npe rau Tus Thawj Xeev tus as khauj ntawm no, yog tias koj tseem tsis tau muaj. Thaum koj tau sau npe thiab nkag mus, nyem rau +lub cim huab nyob rau sab saum toj ntawm koj lub thoob ntim khoom los tsim cov ntaub ntawv tshiab thoob. Qhov no yuav yog lub hom phiaj rau koj cov ntaub ntawv tshaj tawm Google Cov Ntawv. Txhawm rau xa cov ntaub ntawv rau hauv lub thoob no, koj xav tau ob tus yuam sij. Ib qho yog koj tus lej ntiag tug Access Key uas yuav ncaj qha cov ntaub ntawv rau hauv koj tus as khauj. Qhov tseem ceeb thib ob yog Bucket Key, uas yog siv los txheeb xyuas cov ntaub ntawv twg hauv koj tus as khauj cov ntaub ntawv yuav tsum nkag mus. Koj tuaj yeem hais qhia qhov twg Cov Ntsiab Lus Thoob Ntiaj Teb lub npe koj xav tau hauv kab lus tshiab kwj thoob. Koj tus Access Key yuav raug teev tseg ib yam thiab. Nyem rau khawm Tsim los tsim cov ntaub ntawv tshiab no thoob. Koj yuav pom cov ntaub ntawv tshiab thoob hauv koj lub thoob ntim khoom. Koj tuaj yeem nyem rau ntawm Qhov Chaw Txuas hauv qab cov npe thoob cov ntaub ntawv kom pom Cov Pob Tseem Ceeb thiab Nkag Nkag Nkag. Koj yuav xav tau cov yuam sij no rau qib tom ntej. Koj Lub Xeev Thawj Cov Ntaub Ntawv thoob tau npaj los txais cov ntaub ntawv.

Kauj ruam 3: Tsim Google Script

Tsim Google Tsab Ntawv
Tsim Google Tsab Ntawv
Tsim Google Tsab Ntawv
Tsim Google Tsab Ntawv

Tsim ib daim ntawv Google Sheets tshiab. Nyem rau ntawm Tools -> Script editor qhib Google Script editor. Luam thiab paste cov haujlwm hauv qab no rau hauv koj cov ntawv sau:

muaj nuj nqi streamData (signalName, tus nqi, pab tau) {

var accessKey = 'PLACE KOJ ACCESS KEY NTAWM NO'; var bucketKey = 'PLACE KOJ LUB BUCKET KEY NTAWM NO'; yog (! signalName) {signalName = 'UnknownData'; } yog (pab kom) {var url = 'https://groker.init.st/api/events?accessKey=' + accessKey + '& bucketKey =' + bucketKey + '&' + encodeURIComponent (signalName) + '=' + encodeURIComponent (tus nqi); UrlFetchApp.fetch (url); return signalName + '=' + tus nqi; }}

Koj yuav tsum tau tso koj tus as khauj Thawj Lub Xeev Nkag Mus Siv Tus lej ntawm kab 2 thiab koj Lub Xeem Pib Lub Xeev Thoob Ntiaj Teb Tus lej ntawm kab 3 qhov uas tau hais qhia. Nyem rau ntawm File -> Txuag kom txuag tsab ntawv no thiab siv txhua qhov kev hloov pauv (yog tias koj tsis khaws koj qhov kev hloov pauv, koj daim ntawv nthuav tawm tsis tuaj yeem siv txoj haujlwm tshiab no).

Cia peb saib lub luag haujlwm peb nyuam qhuav tsim. streamData (signalName, tus nqi, pab tau) yuav tsum muaj peb qhov kev ntsuas nkag. signalName yog lub npe ntawm cov ntaub ntawv ntws (piv txwv li Kub). tus nqi yog tus nqi tam sim no ntawm cov ntaub ntawv ntws (piv txwv li 50). pab tau yog TRUE lossis FALSE thiab siv los tswj thaum peb xa cov ntaub ntawv mus rau peb cov ntaub ntawv thoob. Kab 8 yog kab ntawv ntawm txoj cai tau hu rau Thawj Lub Xeev API siv URL tsis.

Koj tuaj yeem sim qhov no los ntawm kev kho lub xovtooj ntawm koj daim ntawv nthuav qhia nrog cov qauv: = streamData ("myNumber", 1, TRUE) thiab ntaus ENTER. Yog tias cov ntaub ntawv raug xa mus tiav, lub xov tooj ntawm tes yuav tsum rov qab myNumber = 1.

Rov qab mus rau koj Tus Thawj Xeev tus as khauj thiab nyem rau ntawm koj lub thoob cov ntaub ntawv tshiab. Koj yuav tsum pom tias tus lej 1 tau xa mus rau cov ntaub ntawv tshiab hu ua myNumber. Ua si ib puag ncig nrog kev hloov pauv tus nqi thiab lub npe lub npe thiab saib koj lub dashboard hloov pauv.

Kauj Ruam 4: Ib qho Piv Txwv Spreadsheet

Ib qho Piv Txwv Spreadsheet
Ib qho Piv Txwv Spreadsheet

Qhov txuas no yuav coj koj mus rau piv txwv daim ntawv nthuav qhia uas siv cov haujlwm streamData hauv ob qhov chaw sib txawv, ib qho xa tus nqi ntawm myNumber thiab lwm qhov xa tus nqi ntawm myString. Koj yuav tsum luam qhov piv txwv no thiab rov ua ntu 2 ntxiv rau koj tus kheej Google Script ua haujlwm los ua si nrog daim ntawv no. Kev ua haujlwm tau teev tseg hauv C2. Cias hloov qhov no mus FALSE kom hloov pauv yam tsis xa cov ntaub ntawv tsis xav tau rau koj cov ntaub ntawv thoob thiab rov qab mus rau TRUE kom pab tau cov ntaub ntawv streaming.

Daim ntawv ceeb toom koj tuaj yeem xa cov lej, cov hlua, lossis txawm tias emojis rau koj lub dashboard. Txhua lub sijhawm twg cov tswv yim hloov pauv hloov pauv, cov haujlwm streamData ua tiav thiab xa cov ntaub ntawv.

Kauj Ruam 5: Txheeb Sijhawm Sijhawm (Cov Ntaub Ntawv Los Ntawm Yav Tag Los)

Txheeb Sijhawm Sijhawm (Cov Ntaub Ntawv Los Ntawm Yav Tag Los)
Txheeb Sijhawm Sijhawm (Cov Ntaub Ntawv Los Ntawm Yav Tag Los)
Txheeb Sijhawm Sijhawm (Cov Ntaub Ntawv Los Ntawm Yav Tag Los)
Txheeb Sijhawm Sijhawm (Cov Ntaub Ntawv Los Ntawm Yav Tag Los)

Thawj qhov piv txwv yooj yim xa cov ntaub ntawv ntawm URL ntsuas thaum twg cov ntaub ntawv nkag mus rau peb Google Script ua haujlwm hloov pauv. Lub sijhawm siv rau cov ntaub ntawv taw tes no yog lub sijhawm twg los xij uas API tau txais cov ntaub ntawv. Yuav ua li cas yog tias koj xav kom teev sijhawm sijhawm? Piv txwv li, yog tias koj xav xa cov ntaub ntawv los ntawm ib hlis dhau los rau hauv koj lub dashboard? Initial State API (cov ntaub ntawv ntawm no) tso cai rau peb ua qhov ntawd xwb. Peb tsuas yog yuav tsum sau qhov sib txawv Google Script ua haujlwm uas siv sijhawm timestamp raws li kev ntsuas nkag:

muaj nuj nqi streamDataTime (signalName, tus nqi, timestamp, pab) {

yog (! signalName) {signalName = 'UnknownData'; } var headersIS = {'X-IS-AccessKey': 'PLACE YOUR ACCESS KEY HERE', 'X-IS-BucketKey': 'PLACE YOUR BUCKET KEY HERE', 'Accept-Version': '~ 0'} var data = {'key': signalName, 'value': value, 'iso8601': timestamp}; var options = {'method': 'post', 'contentType': 'application/json', 'headers': headersIS, 'payload': JSON.stringify (cov ntaub ntawv)}; yog (pab kom) {UrlFetchApp.fetch ('https://groker.init.st/api/events', xaiv); return signalName + '=' + tus nqi; }}

Google Tsab ntawv saum toj no ntxiv lub sijhawm sau nkag qhov ntsuas. Tsab ntawv no hu ua Initial State API los ntawm kev xa cov khoom JSON ntawm HTTPS POST. Txhua yam koj yuav tsum tau ua yog qhia koj tus Thawj Xibfwb Nkag Mus Nkag Mus Rau Qhov Tseem Ceeb thiab thoob qhov tseem ceeb ntawm kab 6 thiab 7.

Lub sij hawm yuav tsum yog iso8601 formatted (cov ntaub ntawv ntawm iso8601). Piv txwv iso8601 timestamp is “2019-01–01T18: 00: 00-06: 00”. Timestamp no yog sib npaug rau Lub Ib Hlis 1, 2019, 6:00 teev tsaus ntuj CT. Yog tias koj tsis qhia koj lub sijhawm sijhawm, lub sijhawm yuav tsum yog UTC. Thaum koj saib koj cov ntaub ntawv hauv Lub Xeev Pib hauv Cov Vuas, koj lub browser cheeb tsam lub sijhawm yuav siv los tso saib koj cov ntaub ntawv.

Qhov txuas no yuav coj koj mus rau piv txwv daim ntawv nthuav qhia uas siv cov haujlwm streamDataTime hauv kab F. Koj yuav tsum luam qhov piv txwv no thiab rov ua ntu 2 ntxiv rau koj tus kheej Google Script ua haujlwm los ua si nrog daim ntawv no. Qhov piv txwv no teev tus naj npawb ntawm cov neeg tuaj saib lub vev xaib rau txhua hnub ntawm lub hlis thaum Lub Ib Hlis.

Tshaj tawm qhov piv txwv no daim ntawv nthuav tawm mus rau Thawj Lub Xeev dashboard tuaj yeem zoo li qhov saum toj no (koj tuaj yeem saib cov dashboard no ntawm https://go.init.st/v8sknuq). Daim ntawv ceeb toom ncua sij hawm nyob rau sab saum toj ntawm kab ntawv kab nrog rau lub sijhawm teev tseg hauv Google Cov Ntawv Cov Ntaub Ntawv (kab D). Lub dashboard no siv lub ntsuas cua thiab emojis los ntxiv cov ntsiab lus rau Cov Vuas. Koj tuaj yeem ntshuam qhov txheej txheem dashboard meej rau hauv koj tus piv txwv los ntawm kev ua raws cov lus qhia no. Koj tuaj yeem ntxiv cov duab keeb kwm yav dhau los rau koj lub dashboard kom muab koj cov ntaub ntawv ntau ntxiv.

Kauj Ruam 6: Xaus

Koj tuaj yeem ntxiv ib tus lej ntawm KPIs rau hauv Google Cov Ntawv nthuav tawm thiab xa lawv mus rau lub dashboard siv cov hauv paus ntsiab lus hauv qhov piv txwv no. Koj tuaj yeem teeb tsa ntau daim ntawv nthuav qhia kom xa cov ntaub ntawv mus rau ib qho dashboard. Koj tuaj yeem teeb tsa lub ntsuas hluav taws xob lossis lwm yam ntawv thov xa cov ntaub ntawv mus rau tib lub dashboard zoo li koj daim ntawv Google Sheets thiab tseem ua lej sib txuas ua ke cov ntaub ntawv sib txawv hauv koj lub dashboard.

Pom zoo: