google-analytics-api Tutorial - Getting started with...
文章推薦指數: 80 %
The Google Analytics Embed API is a JavaScript library that allows you to easily create and embed a dashboard on a 3rd party website in a matter of minutes. It ... google-analytics-api Gettingstartedwithgoogle-analytics-api Authentication ErrorResponses Metadataapi Real-timeAPI ReportingAPI(Analyticsv4) google-analytics-api Gettingstartedwithgoogle-analytics-api Authentication ErrorResponses Metadataapi Real-timeAPI ReportingAPI(Analyticsv4) google-analytics-api Gettingstartedwithgoogle-analytics-api Remarks TheGoogleAnalyticsAPIsallowyoutoaccessdatawithinGoogleAnalytics.ItshouldnotbeconfusedwiththemeasurementprotocolwhichisusedforinsertingdataintoGoogleAnalytics. TheGoogleAnalyticsAPIissplitintoservalparts. GoogleAnalyticsReportingAPIs TheGoogleAnalyticsCoreReportingAPIv3givesyouaccesstomostofthereportdatainGoogleAnalytics.WiththeCoreReportingAPIyoucan: BuildcustomdashboardstodisplayGoogleAnalyticsdata. Savetimebyautomatingcomplexreportingtasks. IntegrateyourGoogleAnalyticsdatawithotherbusinessapplications. TheGoogleAnalyticsReportingAPIV4isthemostadvancedprogrammaticmethodtoaccessreportdatainGoogleAnalytics.WiththeGoogleAnalyticsReportingAPI,youcan: BuildcustomdashboardstodisplayGoogleAnalyticsdata. Automatecomplexreportingtaskstosavetime. IntegrateyourGoogleAnalyticsdatawithotherbusinessapplications. TheRealTimeReportingAPIenablesyoutorequestrealtimedata—forexample,realtimeactivityonaview—foranauthenticateduser. YoucanusetheRealTimeReportingAPIto: Displayactiveviewersofapageandcreateasenseofurgencyforuserslookingatanitemwithfiniteinventory. Displaythemostpopularcontentsuchasthetop10activepages. Createanddisplayarealtimedashboard. TheRealTimeReportingAPI,inlimitedbeta,isavailablefor developerpreviewonly.SignuptoaccesstheAPI. TheMulti-ChannelFunnelsReportingAPIenablesyoutorequestMulti-ChannelFunnelsdataforanauthenticateduser.Dataisderivedfromconversionpathdata,whichshowsuserinteractionswithvarioustrafficsourcesovermultiplesessionspriortoconverting.Thisallowsyoutoanalyzehowmultiplemarketingchannelsinfluenceconversionsovertime.Formoredetailsonwhatdataisavailable,readtheAboutMulti-ChannelFunnels,aswellasAboutMulti-ChannelFunnelsData.WiththeMulti-ChannelFunnelsReportingAPIyoucan: CreatecustomreportsusingMulti-ChannelFunnelsdata.Forexample,youcouldusetheTopConversionPathsdatatoreportonattributessuchasrelativepositionofinteractionsinaconversionpath. IntegrateMulti-ChannelFunnelsdatawithyourbusinessdata.Forexample,youcouldcorrelateonlineconversiondatawithofflinesalesdataandmediacostdatatoarriveatamorecompletepictureofmarketingROI. DisplayMulti-ChannelFunnelsinnewenvironments.Forinstance,youcouldcreatevisualizationsandotherpresentationsofthedatathatcommunicatethevalueofdifferentmarketingchannelsindrivingconversions. Helpers TheMetadataAPIreturnsthelistandattributesofcolumns(i.e.dimensionsandmetrics)exposedintheGoogleAnalyticsreportingAPIs.AttributesreturnedincludeUIname,description,segmentssupport,andmore.YoucanusetheMetadataAPIto: Automaticallydiscovernewcolumns. AccessalldimensionsandmetricsattributesforGoogleAnalyticsreportingAPIs. Note:ThisonlyreturnsmetadatafortheCoreReportingAPIandthe ReportingAPI.Notreal-timemetadata. TheGoogleAnalyticsEmbedAPIisaJavaScriptlibrarythatallowsyoutoeasilycreateandembedadashboardona3rdpartywebsiteinamatterofminutes.Itgivesyouasetofpluggablecomponentsthatcanworktogethertobuildcomplextools,makingitbothsimpleandpowerfulatthesametime. ConfigurationAPIs TheAnalyticsManagementAPIallowsforprogrammaticaccesstotheGoogleAnalyticsconfigurationdata.YoucanbuildapplicationstomoreefficientlymanagelargeorcomplexAnalyticsaccounts.Largecompanieswithmanypropertiescanautomateaccountsetup.EvenifyouarebuildingareportingapplicationtheManagementAPIprovidesyoutoolstonavigateyouraccount.YoucanusetheGoogleAnalyticsManagementAPIto: ListalltheAccount,PropertyandViewinformationforauser. ManageProperties,Views,andGoals. Manageuserpermissionsforanaccounthierarchy. RetrieveaViewIDtousewiththeCoreReportingAPI. Determinewhichgoalsareactiveandaccesstheirconfigurednames. ManageLinksbetweenAnalyticspropertiesandAdWordsaccounts. ManageRemarketingAudiences. WriteoperationsintheManagementAPI(e.g.create,update,delete, patch)forWebProperty,View(Profile),andGoalresourcesis currentlyavailableasadeveloperpreviewinlimitedbeta.If you'reinterestedinusingthesefeatures,requestaccesstothe beta. TheProvisioningAPIcanbeusedtocreatenewGoogleAnalyticsaccountsandenableGoogleAnalyticsforyourcustomersatscale.Itisintendedforqualifiedserviceprovidersandlargepartners.Forexample,youcouldusetheProvisioningAPIaspartofanewuseronboardingprocesstocreateanewGoogleAnalyticsaccountforaclientandthenuseadditionalManagementAPIresourcestoprogrammaticallyconfiguretheaccountandlinkittoAdWords.Thiscanallbeautomatedandinitiatedfromwithinyourownadminorreportinginterface. TheProvisioningAPIisavailablebyinvitationonly.Wearenot currentlyacceptingnewprojects. Versions TherearecurrentlythreeversionsoftheGoogleAnalyticsAPIlive. GoogleAnalyticsV2Version2.4oftheCoreReportingAPIisanXML-onlyAPIthatismostlybackwardscompatiblewithversion2.3.(Legacy) GoogleAnalyticsV3whichincludestheCoreReportingAPI,ManagementAPI,MetaDataAPIandannumberofotherAPIs.TheseAPIsreturnJson GoogleAnalyticsV4whichcurrentlyonlyincludesthereportingAPIandisconsideredtobethemostadvancedwayofretrievingreportingdatafromGoogleAnalytics. AccessingGoogleAnalyticsAPIs YoucantechnicallyaccesstheGoogleAnalyticsAPIsusinganyprograminglanguagethatcanhandleaHTTPPostorHTTPGetrequest. Thatbeingsaid,Googlehasalsocreatedanumberofofficialstandardclientlibrariestohelpyouwiththis.Usingastandardclientlibraryforyourchosenprogramminglanguagecanbemucheasierthancodingitfromthegroundupyourself. OFFICALClientlibrarieswithGoogleAnalyticsAPIsupport: GoogleAPIsPHPClientlibrary-GitHub GoogleAPIs.NetClientlibrary-GitHubNuGet GoogleAPIsPythonClientlibrary-GitHub GoogleAPIsJavaClientlibrary-link GoogleAPIsObjective-Clibrary-GitHub Therearemorelibrarieshere. Introduction TheGoogleAnalyticsAPIsallowyoutoaccessdatawithinGoogleAnalytics.ItshouldnotbeconfusedwiththemeasurementprotocolwhichisusedforinsertingdataintoGoogleAnalytics. TheGoogleAnalyticsAPIissplitintoservalparts. GoogleAnalyticsReportingAPIs TheGoogleAnalyticsCoreReportingAPIv3givesyouaccesstomostofthereportdatainGoogleAnalytics.WiththeCoreReportingAPIyoucan: BuildcustomdashboardstodisplayGoogleAnalyticsdata. Savetimebyautomatingcomplexreportingtasks. IntegrateyourGoogleAnalyticsdatawithotherbusinessapplications. TheGoogleAnalyticsReportingAPIV4isthemostadvancedprogrammaticmethodtoaccessreportdatainGoogleAnalytics.WiththeGoogleAnalyticsReportingAPI,youcan: BuildcustomdashboardstodisplayGoogleAnalyticsdata. Automatecomplexreportingtaskstosavetime. IntegrateyourGoogleAnalyticsdatawithotherbusinessapplications. TheRealTimeReportingAPIenablesyoutorequestrealtimedata—forexample,realtimeactivityonaview—foranauthenticateduser. YoucanusetheRealTimeReportingAPIto: Displayactiveviewersofapageandcreateasenseofurgencyforuserslookingatanitemwithfiniteinventory. Displaythemostpopularcontentsuchasthetop10activepages. Createanddisplayarealtimedashboard. TheRealTimeReportingAPI,inlimitedbeta,isavailablefor developerpreviewonly.SignuptoaccesstheAPI. TheMulti-ChannelFunnelsReportingAPIenablesyoutorequestMulti-ChannelFunnelsdataforanauthenticateduser.Dataisderivedfromconversionpathdata,whichshowsuserinteractionswithvarioustrafficsourcesovermultiplesessionspriortoconverting.Thisallowsyoutoanalyzehowmultiplemarketingchannelsinfluenceconversionsovertime.Formoredetailsonwhatdataisavailable,readtheAboutMulti-ChannelFunnels,aswellasAboutMulti-ChannelFunnelsData.WiththeMulti-ChannelFunnelsReportingAPIyoucan: CreatecustomreportsusingMulti-ChannelFunnelsdata.Forexample,youcouldusetheTopConversionPathsdatatoreportonattributessuchasrelativepositionofinteractionsinaconversionpath. IntegrateMulti-ChannelFunnelsdatawithyourbusinessdata.Forexample,youcouldcorrelateonlineconversiondatawithofflinesalesdataandmediacostdatatoarriveatamorecompletepictureofmarketingROI. DisplayMulti-ChannelFunnelsinnewenvironments.Forinstance,youcouldcreatevisualizationsandotherpresentationsofthedatathatcommunicatethevalueofdifferentmarketingchannelsindrivingconversions. Helpers TheMetadataAPIreturnsthelistandattributesofcolumns(i.e.dimensionsandmetrics)exposedintheGoogleAnalyticsreportingAPIs.AttributesreturnedincludeUIname,description,segmentssupport,andmore.YoucanusetheMetadataAPIto: Automaticallydiscovernewcolumns. AccessalldimensionsandmetricsattributesforGoogleAnalyticsreportingAPIs. Note:ThisonlyreturnsmetadatafortheCoreReportingAPIandthe ReportingAPI.Notreal-timemetadata. TheGoogleAnalyticsEmbedAPIisaJavaScriptlibrarythatallowsyoutoeasilycreateandembedadashboardona3rdpartywebsiteinamatterofminutes.Itgivesyouasetofpluggablecomponentsthatcanworktogethertobuildcomplextools,makingitbothsimpleandpowerfulatthesametime. ConfigurationAPIs TheAnalyticsManagementAPIallowsforprogrammaticaccesstotheGoogleAnalyticsconfigurationdata.YoucanbuildapplicationstomoreefficientlymanagelargeorcomplexAnalyticsaccounts.Largecompanieswithmanypropertiescanautomateaccountsetup.EvenifyouarebuildingareportingapplicationtheManagementAPIprovidesyoutoolstonavigateyouraccount.YoucanusetheGoogleAnalyticsManagementAPIto: ListalltheAccount,PropertyandViewinformationforauser. ManageProperties,Views,andGoals. Manageuserpermissionsforanaccounthierarchy. RetrieveaViewIDtousewiththeCoreReportingAPI. Determinewhichgoalsareactiveandaccesstheirconfigurednames. ManageLinksbetweenAnalyticspropertiesandAdWordsaccounts. ManageRemarketingAudiences. WriteoperationsintheManagementAPI(e.g.create,update,delete, patch)forWebProperty,View(Profile),andGoalresourcesis currentlyavailableasadeveloperpreviewinlimitedbeta.If you'reinterestedinusingthesefeatures,requestaccesstothe beta. TheProvisioningAPIcanbeusedtocreatenewGoogleAnalyticsaccountsandenableGoogleAnalyticsforyourcustomersatscale.Itisintendedforqualifiedserviceprovidersandlargepartners.Forexample,youcouldusetheProvisioningAPIaspartofanewuseronboardingprocesstocreateanewGoogleAnalyticsaccountforaclientandthenuseadditionalManagementAPIresourcestoprogrammaticallyconfiguretheaccountandlinkittoAdWords.Thiscanallbeautomatedandinitiatedfromwithinyourownadminorreportinginterface. TheProvisioningAPIisavailablebyinvitationonly.Wearenot currentlyacceptingnewprojects. HelloWorldReportingAPI-Rest POSThttps://analyticsreporting.googleapis.com/v4/reports:batchGet?access_token={Accesstokenfromauthrequest} { "reportRequests":[ { "viewId":"XXXX", "dateRanges":[ { "startDate":"2015-06-15", "endDate":"2015-06-30" }], "metrics":[ { "expression":"ga:sessions" }], "dimensions":[ { "name":"ga:browser" }] }] } Previous Next ThismodifiedtextisanextractoftheoriginalStackOverflowDocumentationcreatedbyfollowingcontributorsandreleasedunderCCBY-SA3.0 ThiswebsiteisnotaffiliatedwithStackOverflow SUPPORT&PARTNERS Advertisewithus Contactus PrivacyPolicy STAYCONNECTED Getmonthlyupdatesaboutnewarticles,cheatsheets,andtricks. Subscribe
延伸文章資訊
- 1[教學] Google Analytics API申請,並將流量分析與單篇瀏覽數
[教學] Google Analytics API申請,並將流量分析與單篇瀏覽數,顯示到WordPress中 ; 外掛名稱:Show Google Analytics widget ; 外掛下載...
- 2[料理佳餚] C# 用Google Analytics Reporting API 來抓取特定 ...
Google Analytics(簡稱GA)是Google 推出的流量分析服務,既免費又強大,做商業網站的我們多少要會一點,通常我們查看流量分析的數據大都是.
- 3Overview | Analytics Reporting API v4 - Google Developers
- 4Google Analytics | Public Workspace | Postman API Network
POST. Google Analytics Request ; x-api-key. DmmrOoppTRaBBGBxsZoPEP1g4HIoRm7BKkwe7u70 ; Content-Ty...
- 5Analytics (分析) API
管理API:Analytics (分析) 管理API 可讓您以Google 資料API 資訊提供格式快速存取Analytics (分析) 帳戶和檢視資料。透過管理API,您可以快速取得與某個使用...