[{"data":1,"prerenderedAt":7232},["ShallowReactive",2],{"blog-en-zoom-in-on-measurement-hub":3,"related-en-zoom-in-on-measurement-hub":1023},{"id":4,"title":5,"author":6,"body":7,"category":1007,"description":301,"extension":1008,"image":1009,"isToc":1010,"langAlt":6,"meta":1011,"metaDescription":6,"navigation":1010,"path":1012,"published":1010,"publishedAt":1013,"readingTimeMinutes":1014,"readingTimeText":1015,"relatedArticles":1016,"seo":1019,"stem":1020,"teaser":1021,"updatedAtCustom":6,"__hash__":1022},"blog_en\u002Fen\u002Fblog\u002Fzoom-in-on-measurement-hub.md","Zoom in on Measurement Hub",null,{"type":8,"value":9,"toc":978},"minimark",[10,15,19,22,25,29,32,35,40,44,60,65,68,72,75,79,82,86,89,92,95,98,101,105,108,112,115,119,142,146,149,153,156,160,163,167,170,174,177,181,184,188,191,195,198,218,222,225,228,231,235,238,242,245,253,256,259,295,793,813,817,820,823,826,914,918,921,925,930,933,937,940,944,947,951,954,958,961,965,968,974],[11,12,14],"h2",{"id":13},"introduction","Introduction",[16,17,18],"p",{},"The process for better customer experience and personalization through improved segmentation starts with data collection of customers' journeys and interactions. In order to achieve the best possible outcomes, it is necessary to collect the data uniformly and set meaningful measurements across various platforms.",[16,20,21],{},"When all marketing and analytical platforms are dependent on the website data, the accuracy of data and its right integration are of the utmost importance. Leveraging the collected data is a competitive advantage that generates exponentially higher marketing investment returns.",[16,23,24],{},"In a perfect scenario, the company has reliable, responsive, and reasonably-priced development resources, the development team is highly skilled, continually cooperates with the SEO and marketing team, or there is an affordable third-party partner. But very frequently that is not the case. The task of high-quality data collected, analyzed, and measured can be vastly complex.",[11,26,28],{"id":27},"what-is-measurement-hub","What is Measurement Hub",[16,30,31],{},"Measurement Hub is not just a box solution, rather a group of complex scripts, yet elevated, more powerful, and more robust deployed via Tag Management System (TMS), commonly used one is Google Tag Manager (GTM). The codes are verified and are standardly pre-defined, can be slightly adjusted, or in case of a complicated case, they can be deeply overhauled. In addition to the scripts, it includes definitions of events and entities for data layer specification. The specification of the data layer is customizable to fit every specific need of every company in order to reach desirable goals. Fully implemented with an omnichannel context, Measurement Hub is dynamic, happening on the user's browser. The data is flowing through; however, it can be stored with integrated data storage. Therefore, Measurement Hub's value is not embedded in the codes only, but also in the expertise of consultancy.",[16,33,34],{},"Simply, Measurement Hub consists of a data layer on the front continuing to tag management system reading, consuming, and distributing the data, including establishing accurate measuring into marketing and analytical platforms. Similar to TMS implementation but much more extended.",[36,37],"image-with-caption",{"source":38,"caption":39},"\u002Fupload\u002Fmhub-schema.webp","Visualization of data flow",[11,41,43],{"id":42},"what-measurement-hub-covers","What Measurement Hub covers?",[45,46,47,51,54,57],"ul",{},[48,49,50],"li",{},"Data layer specification (specification of entities, parameters of entities, events)",[48,52,53],{},"Measurement specification (specification of mapping Data Layer into marketing and analytics platforms)",[48,55,56],{},"Code for all commonly used marketing and analytics platforms (codes which will be implemented into TMS)",[48,58,59],{},"Settings of an analytic platform",[61,62,64],"h3",{"id":63},"maintenance-and-support","Maintenance and support",[16,66,67],{},"After the implementation, standardly you are fully independent, the code is under your ownership in your TMS. We provide an introductory explanation of the configuration and the specification is handed over in an editable document as well. Upon request, we can provide further consultations. We can also manage the Measurement hub and TMS for you.",[11,69,71],{"id":70},"what-measurement-hub-does-not-cover","What Measurement Hub does not cover?",[16,73,74],{},"Measurement Hub doesn’t focus on settings in marketing platforms. After the implementation of Measurement Hub, management of these marketing platforms is done on the company's side or their agencies, but we can help with that. At least there will be measurement specifications for the platform administrator to see what exactly is sent there. In case of additional questions or advice, we provide consultations for the standard hourly rate.",[11,76,78],{"id":77},"why-is-its-implementation-essential","Why is its implementation essential",[16,80,81],{},"Just naming a few of the many advantages of Measurement Hub, the emphasis lays on data layer specification creating the foundation for the rest of the measurement.",[61,83,85],{"id":84},"data-layer-specification","Data layer specification",[16,87,88],{},"Fulfillment of Measurement Hub provides numerous advantages; however, the most valuable one is data layer specification, which imposes data consistency throughout the entire data flow to\u002Ffrom\u002Fin all the platforms, marketing, and analytical.",[16,90,91],{},"A well-constructed data layer (DL) can portray a roadmap to customer communication since thinking beforehand about customer interaction data supports its definition in order to connect all applications.",[16,93,94],{},"Making the data clean and consistent fastens the process and makes it more precise. Measurement Hub offers its own standard, which can fit any case. The specification of DL is customized for the individual needs ensuring the pre-defined requirements will be measured accurately everywhere.",[16,96,97],{},"Data layer specification is crucial for setting up website independence. Often, during website implementation, the data layer gets lost or broken and the measurement with it. The specification helps to discover it is broken and guides the development to fix it correctly. Additionally, the specification within Measurement Hub brings a conceptual solution and when done right from the beginning, it prevents the unnecessary failures of gradual implementation. It serves as a general overview and clear explanation of data layer events and what the data represents for the analysts.",[16,99,100],{},"Without the specification, the quality of the data cannot be validated with such accuracy and newcomers have nothing to understand of your data layer. To elaborate, the specification serves as a detailed manual not only for the development team but also helps your new team members to understand your data layer and measurement. It is better to show the actual documentation and explain the process in practice, than trying to describe it abstractly. From the experience, we observed it is a very handful in case you are expanding your team or there is a sudden change in staff.",[61,102,104],{"id":103},"measurement-specification","Measurement specification",[16,106,107],{},"Mapping of entire data flow within the data infrastructure, from the data layer to each platform is important for analysts, performance teams, online marketing teams, marketing agencies, etc. Knowing what transfers where contributes not only to a better overview and a general understanding of the process, but it can set a foundation for better decisions in, for instance, marketing or business strategy, and unlocks new opportunities.",[61,109,111],{"id":110},"validation","Validation",[16,113,114],{},"Part of the Measurement Hub implementation is a well-coordinated multilevel validation process which is done by our team of specialists who are well trained for this purpose. But there are also several tools, which are helping to reveal some errors in implementation automatically or just leverage effectiveness. Most of these tools were created by the Measurement Hub team itself for these purposes.",[61,116,118],{"id":117},"among-other-advantages-are","Among other advantages are:",[45,120,121,124,127,130,133,136,139],{},[48,122,123],{},"Utilizing the full potential of marketing platforms",[48,125,126],{},"Easier implementation of custom tracking",[48,128,129],{},"Easy control & well-manageable code of measuring",[48,131,132],{},"Complex and conceptual measuring into an analytical platform",[48,134,135],{},"Reliable and uniform measuring of (clean) data",[48,137,138],{},"Automatic error tracking",[48,140,141],{},"Fast and easy integration of new platforms",[11,143,145],{"id":144},"common-problems-when-not-having-measurement-hub-or-when-do-you-need-it","Common problems when not having Measurement Hub (or when do you need it)",[16,147,148],{},"Often, the question of what is behind Measurement Hub implementation, especially in the case of a bigger e-commerce website, when setting up TMS can be done internally. This is true, however, the advantage is not solely in TMS itself. TMS is a means to an end, which in this case can be better user segmentation, targeting, and consistent data structure that supports it all. It requires technical background and knowledge along with business and user understanding to be able to adjust the settings for current and future marketing purposes; to be able to think ahead and from a certain perspective.",[61,150,152],{"id":151},"incorrect-data-duplicity-different-formats-unstructured-missing-data","Incorrect data: duplicity, different formats, unstructured, missing data...",[16,154,155],{},"Measurement Hub provides a set of codes that are implemented into TMS to make the most out of it but consistently and without duplicity. Without Measurement Hub the data is pushed in different formats causing duplicity or lost information. It can be almost impossible to put it all together after it is being pushed incorrectly.",[61,157,159],{"id":158},"website-design-changes","Website design changes",[16,161,162],{},"If website content changes progressively, the data layer gets disrupted or disappears totally and the measurement in the analytical platform cracks and then becomes incorrect, absent, or delayed, requiring substantial changes in settings. Thanks to Measurement Hub's automatic error tracking, the broken data layer is detected on time, can be fixed without a delay and the data damage will be minimal.",[61,164,166],{"id":165},"one-time-help-but-not-bringing-long-term-impact","One-time help but not bringing long-term impact",[16,168,169],{},"An easy and fast solution for a one-time project is not helping the company to grow. Opting for faster and simpler box solutions for smaller problems can help with the project. Measurement Hub looks at the whole picture, understanding the goal of the project and taking into consideration company growth. The elaborate conceptual approach harvests much more benefits in the long run and solves many problems.",[61,171,173],{"id":172},"replacing-platform","Replacing platform",[16,175,176],{},"In case of a need of replacing any current platform (especially analytical) for the new one, the entire measurement can be significantly damaged. Many platforms have their own standard data layer that is developed for their own use but is not compatible with the other platforms. Therefore, its change is extremely difficult and lots of data gets lost in the process. Leveraging Measurement Hub's own data layer, which is flexible and vendor-agnostic, the substitution happens smoothly without interruptions.",[61,178,180],{"id":179},"change-in-the-platform-api","Change in the platform API",[16,182,183],{},"Measurement Hub has its own DL standards that work for many different analytical and marketing platforms, are very flexible towards specific platforms and their changes. It is the first one to know when there is a change in the API of each platform.",[61,185,187],{"id":186},"consent-management-ready","Consent management ready",[16,189,190],{},"With the personal data law enforcement, customer consent needs to be integrated transversally on the entire website. Most TMS lack this extension, especially with GTM it can be almost impossible to execute. Measurement Hub is ready for any Consent Management System, the most common we use is Wecoma, which is in compliance with personal data protection laws, such as GDPR in the EU or CCPA in the US, or any other regulation.",[11,192,194],{"id":193},"what-can-be-achieved","What can be achieved",[16,196,197],{},"The ultimate reason for choosing Measurement Hub is generally improved marketing strategy achieved by:",[45,199,200,203,206,209,212,215],{},[48,201,202],{},"campaign automation and triggering",[48,204,205],{},"better customer experience and personalization",[48,207,208],{},"advanced segmentation and micro-segmentation",[48,210,211],{},"managing marketing audiences for targeting and retargeting",[48,213,214],{},"competitive advantage",[48,216,217],{},"exponentially higher marketing investment returns",[11,219,221],{"id":220},"why-its-different","Why it's different",[16,223,224],{},"On top of all the benefits named above, Measurement Hub and the team executing it solve problems holistically for the company, not for one project. Experiences showed that the conceptual approach should not be forsaken for the seemingly longer execution on the contrary it needs to be prioritized.",[16,226,227],{},"Every third-party analytical and marketing tool has a different way of sending and collecting data, as well as different expectations on when and where their tags should be placed. We understand each platform and its parameters hence we know exactly how to implement them all properly. Measurement Hub is created to match the parameters therefore platform integration is simple and preserves data consistency.",[16,229,230],{},"The service also contains a detailed explanation of the whole process precise definitions of tailored requirements, documentation, and consulting.",[11,232,234],{"id":233},"who-can-benefit","Who can benefit",[16,236,237],{},"Website data measuring is important for every e-commerce company. However, when e-commerce is the core business or brings the most lead and marketing spending is quite significant, simple measuring and analysis are usually not sufficient. Eloquently big companies with complicated and extensive website data architecture tend to neglect the importance of consistency and structure. Reaching higher levels of personalization and accomplishing better marketing campaign results might take even more effort and resources when done manually. Just shaping it together along the way may seem adequate, in the short-term, but eventually, it will catch up later.",[11,239,241],{"id":240},"how-does-it-work","How does it work",[16,243,244],{},"Measurement Hub’s logic in TMS serves its purpose as a middleman between the website and each platform. Some key properties of Measurement Hub:",[45,246,247,250],{},[48,248,249],{},"It is running in the browser of a user visiting your web. Therefore, there is no need for any other server and infrastructure.",[48,251,252],{},"It functions as a real-time stream middleman, thus by itself, it has no database or any storage.",[16,254,255],{},"In general, Measurement Hub takes the data from the data layer in real-time, transforms, and augments them, and immediately sends them into marketing and analytical platforms.",[16,257,258],{},"The whole data flow proceeds as follows:",[260,261,262,285],"ol",{},[48,263,264,268],{},[265,266,267],"strong",{},"Main entities are pushed into the data layer",[45,269,270,273,276,279,282],{},[48,271,272],{},"User – information about the user",[48,274,275],{},"Page – information about the context",[48,277,278],{},"Session – information about the current session",[48,280,281],{},"Order – information about things which user just ordered",[48,283,284],{},"And so on...",[48,286,287,290],{},[265,288,289],{},"Event is pushed into the data layer",[45,291,292],{},[48,293,294],{},"Page – it tells us that pageview happened (but it could be also any other event e.g. Add to cart, Product like, etc.)",[296,297,302],"pre",{"className":298,"code":299,"language":300,"meta":301,"style":301},"language-json shiki shiki-themes material-theme-ocean","{\n  \"page\": {\n    \"type\": \"list\",\n    \"trail\": \"marketing\u002Farticles\",\n    \"list\": {\n      \"pageNumber\": 2,\n      \"filters\": {\n        \"years\": [\"2020\", \"2019\"],\n        \"keywords\": [\"affilates\", \"seo\"]\n      }\n    },\n    \"locale\": \"cs-CZ\",\n    \"currencyCode\": \"CZK\",\n    \"countryCode\": \"CZ\"\n  },\n  \"session\": {\n    \"machine\": \"external\",\n    \"deviceType\": \"mobile\",\n    \"env\": \"prod\"\n  },\n  \"user\": {\n    \"username\": \"tester123\",\n    \"id\": \"66oc39119520732e1s1f23ead6c57\",\n    \"segment\": \"customer.premium\",\n    \"transactionCount\": 2,\n    \"transactionValue\": 799.99\n  },\n  \"event\": \"page\"\n}\n","json","",[303,304,305,314,333,359,380,393,412,426,463,496,502,508,529,550,570,576,590,611,632,651,656,670,691,712,733,749,764,769,787],"code",{"__ignoreMap":301},[306,307,310],"span",{"class":308,"line":309},"line",1,[306,311,313],{"class":312},"sAklC","{\n",[306,315,317,320,324,327,330],{"class":308,"line":316},2,[306,318,319],{"class":312},"  \"",[306,321,323],{"class":322},"sJ14y","page",[306,325,326],{"class":312},"\"",[306,328,329],{"class":312},":",[306,331,332],{"class":312}," {\n",[306,334,336,339,343,345,347,350,354,356],{"class":308,"line":335},3,[306,337,338],{"class":312},"    \"",[306,340,342],{"class":341},"s5Dmg","type",[306,344,326],{"class":312},[306,346,329],{"class":312},[306,348,349],{"class":312}," \"",[306,351,353],{"class":352},"sfyAc","list",[306,355,326],{"class":312},[306,357,358],{"class":312},",\n",[306,360,362,364,367,369,371,373,376,378],{"class":308,"line":361},4,[306,363,338],{"class":312},[306,365,366],{"class":341},"trail",[306,368,326],{"class":312},[306,370,329],{"class":312},[306,372,349],{"class":312},[306,374,375],{"class":352},"marketing\u002Farticles",[306,377,326],{"class":312},[306,379,358],{"class":312},[306,381,383,385,387,389,391],{"class":308,"line":382},5,[306,384,338],{"class":312},[306,386,353],{"class":341},[306,388,326],{"class":312},[306,390,329],{"class":312},[306,392,332],{"class":312},[306,394,396,399,403,405,407,410],{"class":308,"line":395},6,[306,397,398],{"class":312},"      \"",[306,400,402],{"class":401},"sx098","pageNumber",[306,404,326],{"class":312},[306,406,329],{"class":312},[306,408,409],{"class":401}," 2",[306,411,358],{"class":312},[306,413,415,417,420,422,424],{"class":308,"line":414},7,[306,416,398],{"class":312},[306,418,419],{"class":401},"filters",[306,421,326],{"class":312},[306,423,329],{"class":312},[306,425,332],{"class":312},[306,427,429,432,436,438,440,443,445,448,450,453,455,458,460],{"class":308,"line":428},8,[306,430,431],{"class":312},"        \"",[306,433,435],{"class":434},"s-wAU","years",[306,437,326],{"class":312},[306,439,329],{"class":312},[306,441,442],{"class":312}," [",[306,444,326],{"class":312},[306,446,447],{"class":352},"2020",[306,449,326],{"class":312},[306,451,452],{"class":312},",",[306,454,349],{"class":312},[306,456,457],{"class":352},"2019",[306,459,326],{"class":312},[306,461,462],{"class":312},"],\n",[306,464,466,468,471,473,475,477,479,482,484,486,488,491,493],{"class":308,"line":465},9,[306,467,431],{"class":312},[306,469,470],{"class":434},"keywords",[306,472,326],{"class":312},[306,474,329],{"class":312},[306,476,442],{"class":312},[306,478,326],{"class":312},[306,480,481],{"class":352},"affilates",[306,483,326],{"class":312},[306,485,452],{"class":312},[306,487,349],{"class":312},[306,489,490],{"class":352},"seo",[306,492,326],{"class":312},[306,494,495],{"class":312},"]\n",[306,497,499],{"class":308,"line":498},10,[306,500,501],{"class":312},"      }\n",[306,503,505],{"class":308,"line":504},11,[306,506,507],{"class":312},"    },\n",[306,509,511,513,516,518,520,522,525,527],{"class":308,"line":510},12,[306,512,338],{"class":312},[306,514,515],{"class":341},"locale",[306,517,326],{"class":312},[306,519,329],{"class":312},[306,521,349],{"class":312},[306,523,524],{"class":352},"cs-CZ",[306,526,326],{"class":312},[306,528,358],{"class":312},[306,530,532,534,537,539,541,543,546,548],{"class":308,"line":531},13,[306,533,338],{"class":312},[306,535,536],{"class":341},"currencyCode",[306,538,326],{"class":312},[306,540,329],{"class":312},[306,542,349],{"class":312},[306,544,545],{"class":352},"CZK",[306,547,326],{"class":312},[306,549,358],{"class":312},[306,551,553,555,558,560,562,564,567],{"class":308,"line":552},14,[306,554,338],{"class":312},[306,556,557],{"class":341},"countryCode",[306,559,326],{"class":312},[306,561,329],{"class":312},[306,563,349],{"class":312},[306,565,566],{"class":352},"CZ",[306,568,569],{"class":312},"\"\n",[306,571,573],{"class":308,"line":572},15,[306,574,575],{"class":312},"  },\n",[306,577,579,581,584,586,588],{"class":308,"line":578},16,[306,580,319],{"class":312},[306,582,583],{"class":322},"session",[306,585,326],{"class":312},[306,587,329],{"class":312},[306,589,332],{"class":312},[306,591,593,595,598,600,602,604,607,609],{"class":308,"line":592},17,[306,594,338],{"class":312},[306,596,597],{"class":341},"machine",[306,599,326],{"class":312},[306,601,329],{"class":312},[306,603,349],{"class":312},[306,605,606],{"class":352},"external",[306,608,326],{"class":312},[306,610,358],{"class":312},[306,612,614,616,619,621,623,625,628,630],{"class":308,"line":613},18,[306,615,338],{"class":312},[306,617,618],{"class":341},"deviceType",[306,620,326],{"class":312},[306,622,329],{"class":312},[306,624,349],{"class":312},[306,626,627],{"class":352},"mobile",[306,629,326],{"class":312},[306,631,358],{"class":312},[306,633,635,637,640,642,644,646,649],{"class":308,"line":634},19,[306,636,338],{"class":312},[306,638,639],{"class":341},"env",[306,641,326],{"class":312},[306,643,329],{"class":312},[306,645,349],{"class":312},[306,647,648],{"class":352},"prod",[306,650,569],{"class":312},[306,652,654],{"class":308,"line":653},20,[306,655,575],{"class":312},[306,657,659,661,664,666,668],{"class":308,"line":658},21,[306,660,319],{"class":312},[306,662,663],{"class":322},"user",[306,665,326],{"class":312},[306,667,329],{"class":312},[306,669,332],{"class":312},[306,671,673,675,678,680,682,684,687,689],{"class":308,"line":672},22,[306,674,338],{"class":312},[306,676,677],{"class":341},"username",[306,679,326],{"class":312},[306,681,329],{"class":312},[306,683,349],{"class":312},[306,685,686],{"class":352},"tester123",[306,688,326],{"class":312},[306,690,358],{"class":312},[306,692,694,696,699,701,703,705,708,710],{"class":308,"line":693},23,[306,695,338],{"class":312},[306,697,698],{"class":341},"id",[306,700,326],{"class":312},[306,702,329],{"class":312},[306,704,349],{"class":312},[306,706,707],{"class":352},"66oc39119520732e1s1f23ead6c57",[306,709,326],{"class":312},[306,711,358],{"class":312},[306,713,715,717,720,722,724,726,729,731],{"class":308,"line":714},24,[306,716,338],{"class":312},[306,718,719],{"class":341},"segment",[306,721,326],{"class":312},[306,723,329],{"class":312},[306,725,349],{"class":312},[306,727,728],{"class":352},"customer.premium",[306,730,326],{"class":312},[306,732,358],{"class":312},[306,734,736,738,741,743,745,747],{"class":308,"line":735},25,[306,737,338],{"class":312},[306,739,740],{"class":341},"transactionCount",[306,742,326],{"class":312},[306,744,329],{"class":312},[306,746,409],{"class":401},[306,748,358],{"class":312},[306,750,752,754,757,759,761],{"class":308,"line":751},26,[306,753,338],{"class":312},[306,755,756],{"class":341},"transactionValue",[306,758,326],{"class":312},[306,760,329],{"class":312},[306,762,763],{"class":401}," 799.99\n",[306,765,767],{"class":308,"line":766},27,[306,768,575],{"class":312},[306,770,772,774,777,779,781,783,785],{"class":308,"line":771},28,[306,773,319],{"class":312},[306,775,776],{"class":322},"event",[306,778,326],{"class":312},[306,780,329],{"class":312},[306,782,349],{"class":312},[306,784,323],{"class":352},[306,786,569],{"class":312},[306,788,790],{"class":308,"line":789},29,[306,791,792],{"class":312},"}\n",[260,794,795,808],{},[48,796,797,800],{},[265,798,799],{},"When some event is pushed into DL, logic in TMS is triggered and starts consuming all data in DL.",[45,801,802,805],{},[48,803,804],{},"First data are transformed and augmented if needed.",[48,806,807],{},"Then logic for every marketing and analytics platform is triggered and data are transformed and send according to the platform's requirements.",[48,809,810],{},[265,811,812],{},"Data is processed and saved on servers of specific platforms",[11,814,816],{"id":815},"how-is-it-implemented","How is it implemented",[16,818,819],{},"The process starts with the definition of project requirements and is finalized by the implementation of measurement into platforms and proper settings of the analytic platform. The biggest and most important part is revolved around the data layer, its specification, implementation, and validation.",[16,821,822],{},"The implementation process of Measurement Hub consists of a series of steps and may take from a few weeks to several months, depending on the project requirements.",[16,824,825],{},"Implementation process in steps:",[260,827,828,841,854,864,874,884,894,904],{},[48,829,830,833],{},[265,831,832],{},"Consultation on the measurement requirements with the client",[45,834,835,838],{},[48,836,837],{},"This is the phase where we need to gain knowledge of your business and understand your needs. The main measurement concept is created, and critical parts of the measurement are identified. It will define data requirements in marketing and analytics platforms on a general level.",[48,839,840],{},"The requirements are specified by the Measurement Hub team together with a responsible person from your company, usually from the analytical team or performance team.",[48,842,843,846],{},[265,844,845],{},"Creating the data layer specification based on the client’s requirements and website structure",[45,847,848,851],{},[48,849,850],{},"This is the main part of the process. Every entity and every parameter, which could appear in Data Layer, must be properly defined. All events must be defined there.",[48,852,853],{},"It is processed mainly by the Measurement Hub team but with a consultancy with your team.",[48,855,856,859],{},[265,857,858],{},"Specification adjustment with web development",[45,860,861],{},[48,862,863],{},"There is a difference between what an analytics or performance team wants, and how difficult it would be to implement it, if it is even possible and last but not least, how much it would cost. At this stage, developers can alert us to parts of the specification that would be too difficult to implement or that do not logically match, for example, the database structure of the website. The Measurement Hub team then incorporates the decision into the specification.",[48,865,866,869],{},[265,867,868],{},"Data layer implementation",[45,870,871],{},[48,872,873],{},"In this phase, the client's developers must implement the whole DL according to specifications.",[48,875,876,879],{},[265,877,878],{},"Data layer validation",[45,880,881],{},[48,882,883],{},"The data layer is validated manually by the Measurement Hub team. We are checking if events are happening when they should happen and if all parameters are containing what the specification defines. If there is some bug in the implementation, we are giving it back to developers for a fix.)",[48,885,886,889],{},[265,887,888],{},"Implementation of the codes into the preferred tag management system",[45,890,891],{},[48,892,893],{},"Measurement Hub team will implement the content of the tag management system with codes for all marketing and analytics platforms which client want to use according to measurement specification)",[48,895,896,899],{},[265,897,898],{},"Analytical platform settings",[45,900,901],{},[48,902,903],{},"Measurement Hub team prepares full settings of Analytical platform according to measurement specification, including custom dimensions, metrics settings, proper account structure settings, proper campaign grouping, filtering out testing, bots and other not wanted traffic.",[48,905,906,909],{},[265,907,908],{},"Validation of measured data in the analytical platform",[45,910,911],{},[48,912,913],{},"Measurement Hub team validates measured data in analytical data to approve the right implementation of everything above. Also, some errors in DL there could appear due to hidden parts of the web or use case, which was not possible to find out with manual validation.",[11,915,917],{"id":916},"price","Price",[16,919,920],{},"Measurement Hub's price depends on the website’s complexity, a number of marketing and analytics platforms, and individual requirements. Price ranges widely and it needs to be individually defined. There is a one-time payment just for the implementation without further fee for using Measurement Hub. Additionally, we can agree on a support fee for change requests in the specification, measurement codes, and so on.",[11,922,924],{"id":923},"faq","FAQ",[926,927,929],"h4",{"id":928},"what-if-we-do-not-have-any-tag-management-system","What if we do not have any tag management system?",[16,931,932],{},"That is not an obstacle. We can help you to pick the right one for you and include its implementation into the specification for developers.",[926,934,936],{"id":935},"does-measurement-hub-also-work-for-mobile-applications","Does Measurement Hub also work for mobile applications?",[16,938,939],{},"Yes, from a technical point of view it is different, but the concept is almost the same. There is just one main difference in the implementation process - the implementation of marketing and analytics platforms. In the application, the implementation needs to be done fully by your developers. However, we provide full specifications on how to implement Measurement Hub in the mobile application, consistently aligned with website measurement.",[926,941,943],{"id":942},"what-if-we-have-already-implemented-something-in-our-tms","What if we have already implemented something in our TMS?",[16,945,946],{},"That is not a problem. We can choose from several approaches, depending on the quality of the content of your current TMS and your preferences. We can investigate the functionality in your current TMS and propose solutions for improvement. A few options that can be either use part of it or all of it, or just overwrite it all.",[926,948,950],{"id":949},"what-if-our-developers-do-not-cooperate-they-are-overloaded-with-other-higher-priority-tasks-or-they-cannot-help-us-for-a-different-reason","What if our developers do not cooperate, they are overloaded with other higher priority tasks, or they cannot help us for a different reason?",[16,952,953],{},"This can be a huge complication, which will definitely have an impact on the quality of the result. But we can help even in this case. It is possible to detect many things directly in TMS without developers' DL, which means without developers' help. We can develop some workarounds that can help you to get as much as possible from your website without developers.",[926,955,957],{"id":956},"what-if-i-already-have-implemented-the-data-layer","What if I already have implemented the data layer?",[16,959,960],{},"We always prefer to create a new property for the new data layer to not be in conflict with the old one. The best practice is to also create a new TMS container for Measurement Hub and in that case, we have totally separated the old and the new measurement.",[926,962,964],{"id":963},"what-about-the-continuality-of-my-data","What about the continuality of my data?",[16,966,967],{},"We are always preparing the specification with respect to your current measurement. We are discussing with you where we can break continuality for better measurement usability and the final decision is always on you.",[969,970,973],"action",{"link":971,"button":972},"\u002Fen\u002Fget-in-touch\u002F","Get in touch with us!","\nWant to know more about Measurement Hub and how you can benefit from it?\n",[975,976,977],"style",{},"html pre.shiki code .sAklC, html code.shiki .sAklC{--shiki-default:#89DDFF}html pre.shiki code .sJ14y, html code.shiki .sJ14y{--shiki-default:#C792EA}html pre.shiki code .s5Dmg, html code.shiki .s5Dmg{--shiki-default:#FFCB6B}html pre.shiki code .sfyAc, html code.shiki .sfyAc{--shiki-default:#C3E88D}html pre.shiki code .sx098, html code.shiki .sx098{--shiki-default:#F78C6C}html pre.shiki code .s-wAU, html code.shiki .s-wAU{--shiki-default:#F07178}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":301,"searchDepth":316,"depth":316,"links":979},[980,981,982,985,986,992,1000,1001,1002,1003,1004,1005,1006],{"id":13,"depth":316,"text":14},{"id":27,"depth":316,"text":28},{"id":42,"depth":316,"text":43,"children":983},[984],{"id":63,"depth":335,"text":64},{"id":70,"depth":316,"text":71},{"id":77,"depth":316,"text":78,"children":987},[988,989,990,991],{"id":84,"depth":335,"text":85},{"id":103,"depth":335,"text":104},{"id":110,"depth":335,"text":111},{"id":117,"depth":335,"text":118},{"id":144,"depth":316,"text":145,"children":993},[994,995,996,997,998,999],{"id":151,"depth":335,"text":152},{"id":158,"depth":335,"text":159},{"id":165,"depth":335,"text":166},{"id":172,"depth":335,"text":173},{"id":179,"depth":335,"text":180},{"id":186,"depth":335,"text":187},{"id":193,"depth":316,"text":194},{"id":220,"depth":316,"text":221},{"id":233,"depth":316,"text":234},{"id":240,"depth":316,"text":241},{"id":815,"depth":316,"text":816},{"id":916,"depth":316,"text":917},{"id":923,"depth":316,"text":924},"Products","md","\u002Fupload\u002Fmeasurement-hub-article-title-picture.webp",true,{},"\u002Fen\u002Fblog\u002Fzoom-in-on-measurement-hub","2020-06-25T12:00:00.000+00:00",15.86,"16 min read",[1017,1018],"content\u002Fen\u002Fblog\u002Fnotes-on-new-features-of-google-analytics-reporting-api-v4.md","content\u002Fen\u002Fblog\u002Fnew-data-api-for-google-analytics-4.md",{"title":5,"description":301},"en\u002Fblog\u002Fzoom-in-on-measurement-hub","Make the data clean, focused, and make all marketing campaigns more effective. Leveraging the collected data is a competitive advantage that generates exponentially higher marketing investment returns.","RHzQSC5vtEVUzNdvkmdpxHJCHBOl3wg9Lro8zMPmQM0",[1024,5207],{"id":1025,"title":1026,"author":6,"body":1027,"category":6,"description":5191,"extension":1008,"image":5192,"isToc":5193,"langAlt":6,"meta":5194,"metaDescription":5195,"navigation":1010,"path":5196,"published":1010,"publishedAt":5197,"readingTimeMinutes":5198,"readingTimeText":5199,"relatedArticles":5200,"seo":5202,"stem":5203,"teaser":5204,"updatedAtCustom":5205,"__hash__":5206},"blog_en\u002Fen\u002Fblog\u002Fnew-data-api-for-google-analytics-4.md","New Data API for Google Analytics 4",{"type":8,"value":1028,"toc":5175},[1029,1044,1056,1066,1077,1080,1084,1096,1102,1105,1146,1151,1389,1394,1645,1649,1652,1693,1698,2159,2164,2669,2672,2676,2680,2683,2710,2915,2919,2926,2947,2950,2975,3432,3461,3465,3480,3483,3486,3493,4027,4036,4040,4054,4059,4062,4067,4071,4081,4084,4439,4443,4459,4462,4465,4489,4753,4820,4826,4830,4833,4844,4871,4878,4887,4896,4904,5135,5139,5142,5168,5172],[16,1030,1031,1032,1035,1036,1039,1040,1043],{},"The ",[265,1033,1034],{},"new version of Google Analytics"," with an innovative approach to data structure has been introduced in summer 2019, under the name Google Analytics App + Web. In autumn 2020 Google released it from the beta version and rebranded it as ",[265,1037,1038],{},"Google Analytics 4",". While it is still not recommended to transfer your whole data measurement to the new version as it is being gradually improved, it definitely deserves increased attention as Google is introducing many new features there. The new Google Analytics 4 is based on events and their parameters. As its previous name implies, it combines data from apps and web analytics in one property. Moreover, it serves as a flexible tool ",[265,1041,1042],{},"for cross-platform analysis",". To learn more about Google Analytics 4, follow our blog for an upcoming article in which we will discuss changes and new features of the GA4, extensively.",[1045,1046,1047,1048,1055],"note",{},"\nThis article describes the use of Data API for the new version of Google Analytics, GA4. If you are interested in the GA Reporting API V4 used for the Universal Google Analytics, check out \n",[1049,1050,1054],"a",{"href":1051,"rel":1052},"https:\u002F\u002Fcrossmasters.com\u002Fen\u002Fblog\u002Fnotes-on-new-features-of-google-analytics-reporting-api-v4\u002F",[1053],"nofollow","the article dedicated to UA API","\n.\n",[16,1057,1058,1059,1065],{},"In this article, we speak about approaches to query data from Google Analytics 4 using the Google Analytics Data API (further abbreviated as GA4 API). The GA4 API is still available only in the ",[265,1060,1061],{},[1062,1063,1064],"em",{},"beta version"," but it is never too early to study its features and learn how to benefit from them. We present the API mainly using examples of the JSON-structured request body that can be used in a cURL, HTTP request, or in JavaScript. At the end of the article, you will find a sample code to run a query in Python using the library google-analytics-data prepared directly from Google.",[1067,1068,1069,1070,1076],"tip",{},"\nFor testing queries to the GA4 API you can also use the \n",[1049,1071,1075],{"href":1072,"rel":1073,"title":1074},"https:\u002F\u002Fwaaila.com\u002F",[1053],"Waaila","WAAILA","\n application. WAAILA is a comprehensive tool for data quality control that allows you to access data from multiple analytical data providers, including Google Analytics 4. The extracted data can be further evaluated in WAAILA using pre-built or custom tests to monitor measurement quality and recognize potential data issues in time.\n",[16,1078,1079],{},"Remember that this article is only about the Data API, which means the API for querying the measured information about your sites. Google is also introducing a new Admin API for displaying and changing the settings of Google Analytics. We will investigate that in a future article.",[11,1081,1083],{"id":1082},"one-simple-query-querying-data-using-runreport-method","One simple query - querying data using runReport method",[16,1085,1086,1087,1090,1091,1095],{},"The easiest way to extract data is using the ",[265,1088,1089],{},"runReport"," method which allows running a single request to data in order to receive a single set of results. To obtain data a POST request is sent to URL ",[1049,1092,1093],{"href":1093,"rel":1094},"https:\u002F\u002Fanalyticsdata.googleapis.com\u002Fv1beta\u002F",[1053],"\u003CGA4_PROPERTY_ID>:runReport where you need to replace the placeholder \u003CGA4_PROPERTY_ID> with your GA 4 property ID. The basic parameters of a single query have a very similar structure to queries constructed for the Universal Analytics API (further denoted as original API). Therefore, if you are now using the original API with the basic functionality of the API queries, there will be only minor adjustments needed. Bigger differences to the original API lie in its further options and extensions, for example, quotas report or a special request for pivot data. These will be presented in further sections of the article.",[61,1097,1099],{"id":1098},"differences-between-data-queries",[265,1100,1101],{},"Differences between data queries",[16,1103,1104],{},"To illustrate the similarities and differences we show an example of a simple query of sessions over 3 days. This query gives you information about how your sessions have evolved in the last three days. Below we include the request body for both the GA4 API and the original API. As you can see below, there are some differences between the queries.",[260,1106,1107,1110,1128],{},[48,1108,1109],{},"The easiest noticeable difference is that there is no parameter with view ID or property ID in the query. This information is passed directly into the request url (as mentioned above).",[48,1111,1112,1113,1116,1117,1120,1121,1124,1125,1127],{},"The GA4 API introduced ",[265,1114,1115],{},"consistency"," between specifying dimensions’ and metrics’ names because names of both metrics and dimensions are specified in parameter ",[303,1118,1119],{},"name",", not ",[303,1122,1123],{},"expression"," for metrics and ",[303,1126,1119],{}," for dimensions as before.",[48,1129,1130,1131,1134,1135,1138,1139,1141,1142,1145],{},"Lastly, the ",[303,1132,1133],{},"orderBys"," has a slightly different structure, where you ",[265,1136,1137],{},"differentiate"," if you order by ",[265,1140,1049],{}," ",[265,1143,1144],{},"dimension, a metric, or a pivot group"," and you specify the direction of ordering for all listed columns together.",[16,1147,1148],{},[1062,1149,1150],{},"The query for GA4 example",[296,1152,1154],{"className":298,"code":1153,"language":300,"meta":301,"style":301},"{\n  \"dateRanges\": [\n    {\n      \"startDate\": \"2021-01-04\",\n      \"endDate\": \"2021-01-06\"\n    }\n  ],\n  \"metrics\": [\n    {\n      \"name\": \"sessions\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"name\": \"date\"\n    }\n  ],\n  \"orderBys\": [\n    {\n      \"metric\": {\n        \"metricName\": \"sessions\"\n      },\n      \"desc\": true\n    }\n  ]\n}\n",[303,1155,1156,1160,1174,1179,1199,1217,1222,1227,1240,1244,1261,1265,1269,1282,1286,1303,1307,1311,1323,1327,1340,1357,1362,1376,1380,1385],{"__ignoreMap":301},[306,1157,1158],{"class":308,"line":309},[306,1159,313],{"class":312},[306,1161,1162,1164,1167,1169,1171],{"class":308,"line":316},[306,1163,319],{"class":312},[306,1165,1166],{"class":322},"dateRanges",[306,1168,326],{"class":312},[306,1170,329],{"class":312},[306,1172,1173],{"class":312}," [\n",[306,1175,1176],{"class":308,"line":335},[306,1177,1178],{"class":312},"    {\n",[306,1180,1181,1183,1186,1188,1190,1192,1195,1197],{"class":308,"line":361},[306,1182,398],{"class":312},[306,1184,1185],{"class":341},"startDate",[306,1187,326],{"class":312},[306,1189,329],{"class":312},[306,1191,349],{"class":312},[306,1193,1194],{"class":352},"2021-01-04",[306,1196,326],{"class":312},[306,1198,358],{"class":312},[306,1200,1201,1203,1206,1208,1210,1212,1215],{"class":308,"line":382},[306,1202,398],{"class":312},[306,1204,1205],{"class":341},"endDate",[306,1207,326],{"class":312},[306,1209,329],{"class":312},[306,1211,349],{"class":312},[306,1213,1214],{"class":352},"2021-01-06",[306,1216,569],{"class":312},[306,1218,1219],{"class":308,"line":395},[306,1220,1221],{"class":312},"    }\n",[306,1223,1224],{"class":308,"line":414},[306,1225,1226],{"class":312},"  ],\n",[306,1228,1229,1231,1234,1236,1238],{"class":308,"line":428},[306,1230,319],{"class":312},[306,1232,1233],{"class":322},"metrics",[306,1235,326],{"class":312},[306,1237,329],{"class":312},[306,1239,1173],{"class":312},[306,1241,1242],{"class":308,"line":465},[306,1243,1178],{"class":312},[306,1245,1246,1248,1250,1252,1254,1256,1259],{"class":308,"line":498},[306,1247,398],{"class":312},[306,1249,1119],{"class":341},[306,1251,326],{"class":312},[306,1253,329],{"class":312},[306,1255,349],{"class":312},[306,1257,1258],{"class":352},"sessions",[306,1260,569],{"class":312},[306,1262,1263],{"class":308,"line":504},[306,1264,1221],{"class":312},[306,1266,1267],{"class":308,"line":510},[306,1268,1226],{"class":312},[306,1270,1271,1273,1276,1278,1280],{"class":308,"line":531},[306,1272,319],{"class":312},[306,1274,1275],{"class":322},"dimensions",[306,1277,326],{"class":312},[306,1279,329],{"class":312},[306,1281,1173],{"class":312},[306,1283,1284],{"class":308,"line":552},[306,1285,1178],{"class":312},[306,1287,1288,1290,1292,1294,1296,1298,1301],{"class":308,"line":572},[306,1289,398],{"class":312},[306,1291,1119],{"class":341},[306,1293,326],{"class":312},[306,1295,329],{"class":312},[306,1297,349],{"class":312},[306,1299,1300],{"class":352},"date",[306,1302,569],{"class":312},[306,1304,1305],{"class":308,"line":578},[306,1306,1221],{"class":312},[306,1308,1309],{"class":308,"line":592},[306,1310,1226],{"class":312},[306,1312,1313,1315,1317,1319,1321],{"class":308,"line":613},[306,1314,319],{"class":312},[306,1316,1133],{"class":322},[306,1318,326],{"class":312},[306,1320,329],{"class":312},[306,1322,1173],{"class":312},[306,1324,1325],{"class":308,"line":634},[306,1326,1178],{"class":312},[306,1328,1329,1331,1334,1336,1338],{"class":308,"line":653},[306,1330,398],{"class":312},[306,1332,1333],{"class":341},"metric",[306,1335,326],{"class":312},[306,1337,329],{"class":312},[306,1339,332],{"class":312},[306,1341,1342,1344,1347,1349,1351,1353,1355],{"class":308,"line":658},[306,1343,431],{"class":312},[306,1345,1346],{"class":401},"metricName",[306,1348,326],{"class":312},[306,1350,329],{"class":312},[306,1352,349],{"class":312},[306,1354,1258],{"class":352},[306,1356,569],{"class":312},[306,1358,1359],{"class":308,"line":672},[306,1360,1361],{"class":312},"      },\n",[306,1363,1364,1366,1369,1371,1373],{"class":308,"line":693},[306,1365,398],{"class":312},[306,1367,1368],{"class":341},"desc",[306,1370,326],{"class":312},[306,1372,329],{"class":312},[306,1374,1375],{"class":312}," true\n",[306,1377,1378],{"class":308,"line":714},[306,1379,1221],{"class":312},[306,1381,1382],{"class":308,"line":735},[306,1383,1384],{"class":312},"  ]\n",[306,1386,1387],{"class":308,"line":751},[306,1388,792],{"class":312},[16,1390,1391],{},[1062,1392,1393],{},"The query for UA for comparison",[296,1395,1397],{"className":298,"code":1396,"language":300,"meta":301,"style":301},"{\n  \"viewId\": \"XXXXXXXXX\",\n  \"dateRanges\": [\n    {\n      \"startDate\": \"2021-01-04\",\n      \"endDate\": \"2021-01-06\"\n    }\n  ],\n  \"metrics\": [\n    {\n      \"expression\": \"ga:sessions\",\n      \"alias\": \"\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"name\": \"ga:date\"\n    }\n  ],\n  \"orderBys\": [\n    {\n      \"sortOrder\": \"DESCENDING\",\n      \"fieldName\": \"ga:users\"\n    }\n  ]\n}\n",[303,1398,1399,1403,1423,1435,1439,1457,1473,1477,1481,1493,1497,1516,1530,1534,1538,1550,1554,1571,1575,1579,1591,1595,1615,1633,1637,1641],{"__ignoreMap":301},[306,1400,1401],{"class":308,"line":309},[306,1402,313],{"class":312},[306,1404,1405,1407,1410,1412,1414,1416,1419,1421],{"class":308,"line":316},[306,1406,319],{"class":312},[306,1408,1409],{"class":322},"viewId",[306,1411,326],{"class":312},[306,1413,329],{"class":312},[306,1415,349],{"class":312},[306,1417,1418],{"class":352},"XXXXXXXXX",[306,1420,326],{"class":312},[306,1422,358],{"class":312},[306,1424,1425,1427,1429,1431,1433],{"class":308,"line":335},[306,1426,319],{"class":312},[306,1428,1166],{"class":322},[306,1430,326],{"class":312},[306,1432,329],{"class":312},[306,1434,1173],{"class":312},[306,1436,1437],{"class":308,"line":361},[306,1438,1178],{"class":312},[306,1440,1441,1443,1445,1447,1449,1451,1453,1455],{"class":308,"line":382},[306,1442,398],{"class":312},[306,1444,1185],{"class":341},[306,1446,326],{"class":312},[306,1448,329],{"class":312},[306,1450,349],{"class":312},[306,1452,1194],{"class":352},[306,1454,326],{"class":312},[306,1456,358],{"class":312},[306,1458,1459,1461,1463,1465,1467,1469,1471],{"class":308,"line":395},[306,1460,398],{"class":312},[306,1462,1205],{"class":341},[306,1464,326],{"class":312},[306,1466,329],{"class":312},[306,1468,349],{"class":312},[306,1470,1214],{"class":352},[306,1472,569],{"class":312},[306,1474,1475],{"class":308,"line":414},[306,1476,1221],{"class":312},[306,1478,1479],{"class":308,"line":428},[306,1480,1226],{"class":312},[306,1482,1483,1485,1487,1489,1491],{"class":308,"line":465},[306,1484,319],{"class":312},[306,1486,1233],{"class":322},[306,1488,326],{"class":312},[306,1490,329],{"class":312},[306,1492,1173],{"class":312},[306,1494,1495],{"class":308,"line":498},[306,1496,1178],{"class":312},[306,1498,1499,1501,1503,1505,1507,1509,1512,1514],{"class":308,"line":504},[306,1500,398],{"class":312},[306,1502,1123],{"class":341},[306,1504,326],{"class":312},[306,1506,329],{"class":312},[306,1508,349],{"class":312},[306,1510,1511],{"class":352},"ga:sessions",[306,1513,326],{"class":312},[306,1515,358],{"class":312},[306,1517,1518,1520,1523,1525,1527],{"class":308,"line":510},[306,1519,398],{"class":312},[306,1521,1522],{"class":341},"alias",[306,1524,326],{"class":312},[306,1526,329],{"class":312},[306,1528,1529],{"class":312}," \"\"\n",[306,1531,1532],{"class":308,"line":531},[306,1533,1221],{"class":312},[306,1535,1536],{"class":308,"line":552},[306,1537,1226],{"class":312},[306,1539,1540,1542,1544,1546,1548],{"class":308,"line":572},[306,1541,319],{"class":312},[306,1543,1275],{"class":322},[306,1545,326],{"class":312},[306,1547,329],{"class":312},[306,1549,1173],{"class":312},[306,1551,1552],{"class":308,"line":578},[306,1553,1178],{"class":312},[306,1555,1556,1558,1560,1562,1564,1566,1569],{"class":308,"line":592},[306,1557,398],{"class":312},[306,1559,1119],{"class":341},[306,1561,326],{"class":312},[306,1563,329],{"class":312},[306,1565,349],{"class":312},[306,1567,1568],{"class":352},"ga:date",[306,1570,569],{"class":312},[306,1572,1573],{"class":308,"line":613},[306,1574,1221],{"class":312},[306,1576,1577],{"class":308,"line":634},[306,1578,1226],{"class":312},[306,1580,1581,1583,1585,1587,1589],{"class":308,"line":653},[306,1582,319],{"class":312},[306,1584,1133],{"class":322},[306,1586,326],{"class":312},[306,1588,329],{"class":312},[306,1590,1173],{"class":312},[306,1592,1593],{"class":308,"line":658},[306,1594,1178],{"class":312},[306,1596,1597,1599,1602,1604,1606,1608,1611,1613],{"class":308,"line":672},[306,1598,398],{"class":312},[306,1600,1601],{"class":341},"sortOrder",[306,1603,326],{"class":312},[306,1605,329],{"class":312},[306,1607,349],{"class":312},[306,1609,1610],{"class":352},"DESCENDING",[306,1612,326],{"class":312},[306,1614,358],{"class":312},[306,1616,1617,1619,1622,1624,1626,1628,1631],{"class":308,"line":693},[306,1618,398],{"class":312},[306,1620,1621],{"class":341},"fieldName",[306,1623,326],{"class":312},[306,1625,329],{"class":312},[306,1627,349],{"class":312},[306,1629,1630],{"class":352},"ga:users",[306,1632,569],{"class":312},[306,1634,1635],{"class":308,"line":714},[306,1636,1221],{"class":312},[306,1638,1639],{"class":308,"line":735},[306,1640,1384],{"class":312},[306,1642,1643],{"class":308,"line":751},[306,1644,792],{"class":312},[61,1646,1648],{"id":1647},"differences-between-results","Differences between results",[16,1650,1651],{},"The results have a comparable structure as well, where the tendency of the GA4 API seems to make the results more consistent and reduce additional information unless directly queried. Below we present the results for the data queries, specified above, and list the differences between them.",[260,1653,1654,1661,1686],{},[48,1655,1656,1657,1660],{},"The values for ",[265,1658,1659],{},"dimensions and metrics have the same structure"," in GA4 API in contrast to the original API, where dimension values are presented in an array while metrics are in an object with an array of values. This simplifies the extraction of the data.",[48,1662,1663,1666,1667,1670,1671,1674,1675,1674,1678,1681,1682,1685],{},[265,1664,1665],{},"The summary values are not included"," automatically in the GA4 API. To receive any aggregated metrics, you need to specify which aggregation you need in a new parameter ",[303,1668,1669],{},"metricAggregations"," with options ",[303,1672,1673],{},"TOTAL",", ",[303,1676,1677],{},"MINIMUM",[303,1679,1680],{},"MAXIMUM",", and ",[303,1683,1684],{},"COUNT",". Therefore, you can receive the same information as through the original API but you won’t get it automatically.",[48,1687,1688,1689,1692],{},"The column header is separated for metrics and dimensions but in contrast to the original API it has the same structure for both metrics and dimensions. This corresponds to the introduced ",[265,1690,1691],{},"consistency in presenting values"," and in querying the names of metrics and dimensions.",[16,1694,1695],{},[1062,1696,1697],{},"The results from GA4 example:",[296,1699,1701],{"className":298,"code":1700,"language":300,"meta":301,"style":301},"{\n  \"metricHeaders\": [\n    {\n      \"name\": \"sessions\",\n      \"type\": \"TYPE_INTEGER\"\n    }\n  ],\n  \"rows\": [\n    {\n      \"dimensionValues\": [\n        {\n          \"value\": \"20210104\"\n        }\n      ],\n      \"metricValues\": [\n        {\n          \"value\": \"12900\"\n        }\n      ]\n    },\n    {\n      \"dimensionValues\": [\n        {\n          \"value\": \"20210105\"\n        }\n      ],\n      \"metricValues\": [\n        {\n          \"value\": \"10700\"\n        }\n      ]\n    },\n    {\n      \"dimensionValues\": [\n        {\n          \"value\": \"20210106\"\n        }\n      ],\n      \"metricValues\": [\n        {\n          \"value\": \"11300\"\n        }\n      ]\n    }\n  ],\n  \"metadata\": {},\n  \"dimensionHeaders\": [\n    {\n      \"name\": \"date\"\n    }\n  ],\n  \"rowCount\": 3\n}\n",[303,1702,1703,1707,1720,1724,1742,1759,1763,1767,1780,1784,1797,1802,1821,1826,1831,1844,1848,1865,1869,1874,1878,1882,1894,1898,1915,1919,1923,1935,1939,1956,1961,1966,1971,1976,1989,1994,2012,2017,2022,2035,2040,2058,2063,2068,2073,2078,2093,2107,2112,2129,2134,2139,2154],{"__ignoreMap":301},[306,1704,1705],{"class":308,"line":309},[306,1706,313],{"class":312},[306,1708,1709,1711,1714,1716,1718],{"class":308,"line":316},[306,1710,319],{"class":312},[306,1712,1713],{"class":322},"metricHeaders",[306,1715,326],{"class":312},[306,1717,329],{"class":312},[306,1719,1173],{"class":312},[306,1721,1722],{"class":308,"line":335},[306,1723,1178],{"class":312},[306,1725,1726,1728,1730,1732,1734,1736,1738,1740],{"class":308,"line":361},[306,1727,398],{"class":312},[306,1729,1119],{"class":341},[306,1731,326],{"class":312},[306,1733,329],{"class":312},[306,1735,349],{"class":312},[306,1737,1258],{"class":352},[306,1739,326],{"class":312},[306,1741,358],{"class":312},[306,1743,1744,1746,1748,1750,1752,1754,1757],{"class":308,"line":382},[306,1745,398],{"class":312},[306,1747,342],{"class":341},[306,1749,326],{"class":312},[306,1751,329],{"class":312},[306,1753,349],{"class":312},[306,1755,1756],{"class":352},"TYPE_INTEGER",[306,1758,569],{"class":312},[306,1760,1761],{"class":308,"line":395},[306,1762,1221],{"class":312},[306,1764,1765],{"class":308,"line":414},[306,1766,1226],{"class":312},[306,1768,1769,1771,1774,1776,1778],{"class":308,"line":428},[306,1770,319],{"class":312},[306,1772,1773],{"class":322},"rows",[306,1775,326],{"class":312},[306,1777,329],{"class":312},[306,1779,1173],{"class":312},[306,1781,1782],{"class":308,"line":465},[306,1783,1178],{"class":312},[306,1785,1786,1788,1791,1793,1795],{"class":308,"line":498},[306,1787,398],{"class":312},[306,1789,1790],{"class":341},"dimensionValues",[306,1792,326],{"class":312},[306,1794,329],{"class":312},[306,1796,1173],{"class":312},[306,1798,1799],{"class":308,"line":504},[306,1800,1801],{"class":312},"        {\n",[306,1803,1804,1807,1810,1812,1814,1816,1819],{"class":308,"line":510},[306,1805,1806],{"class":312},"          \"",[306,1808,1809],{"class":401},"value",[306,1811,326],{"class":312},[306,1813,329],{"class":312},[306,1815,349],{"class":312},[306,1817,1818],{"class":352},"20210104",[306,1820,569],{"class":312},[306,1822,1823],{"class":308,"line":531},[306,1824,1825],{"class":312},"        }\n",[306,1827,1828],{"class":308,"line":552},[306,1829,1830],{"class":312},"      ],\n",[306,1832,1833,1835,1838,1840,1842],{"class":308,"line":572},[306,1834,398],{"class":312},[306,1836,1837],{"class":341},"metricValues",[306,1839,326],{"class":312},[306,1841,329],{"class":312},[306,1843,1173],{"class":312},[306,1845,1846],{"class":308,"line":578},[306,1847,1801],{"class":312},[306,1849,1850,1852,1854,1856,1858,1860,1863],{"class":308,"line":592},[306,1851,1806],{"class":312},[306,1853,1809],{"class":401},[306,1855,326],{"class":312},[306,1857,329],{"class":312},[306,1859,349],{"class":312},[306,1861,1862],{"class":352},"12900",[306,1864,569],{"class":312},[306,1866,1867],{"class":308,"line":613},[306,1868,1825],{"class":312},[306,1870,1871],{"class":308,"line":634},[306,1872,1873],{"class":312},"      ]\n",[306,1875,1876],{"class":308,"line":653},[306,1877,507],{"class":312},[306,1879,1880],{"class":308,"line":658},[306,1881,1178],{"class":312},[306,1883,1884,1886,1888,1890,1892],{"class":308,"line":672},[306,1885,398],{"class":312},[306,1887,1790],{"class":341},[306,1889,326],{"class":312},[306,1891,329],{"class":312},[306,1893,1173],{"class":312},[306,1895,1896],{"class":308,"line":693},[306,1897,1801],{"class":312},[306,1899,1900,1902,1904,1906,1908,1910,1913],{"class":308,"line":714},[306,1901,1806],{"class":312},[306,1903,1809],{"class":401},[306,1905,326],{"class":312},[306,1907,329],{"class":312},[306,1909,349],{"class":312},[306,1911,1912],{"class":352},"20210105",[306,1914,569],{"class":312},[306,1916,1917],{"class":308,"line":735},[306,1918,1825],{"class":312},[306,1920,1921],{"class":308,"line":751},[306,1922,1830],{"class":312},[306,1924,1925,1927,1929,1931,1933],{"class":308,"line":766},[306,1926,398],{"class":312},[306,1928,1837],{"class":341},[306,1930,326],{"class":312},[306,1932,329],{"class":312},[306,1934,1173],{"class":312},[306,1936,1937],{"class":308,"line":771},[306,1938,1801],{"class":312},[306,1940,1941,1943,1945,1947,1949,1951,1954],{"class":308,"line":789},[306,1942,1806],{"class":312},[306,1944,1809],{"class":401},[306,1946,326],{"class":312},[306,1948,329],{"class":312},[306,1950,349],{"class":312},[306,1952,1953],{"class":352},"10700",[306,1955,569],{"class":312},[306,1957,1959],{"class":308,"line":1958},30,[306,1960,1825],{"class":312},[306,1962,1964],{"class":308,"line":1963},31,[306,1965,1873],{"class":312},[306,1967,1969],{"class":308,"line":1968},32,[306,1970,507],{"class":312},[306,1972,1974],{"class":308,"line":1973},33,[306,1975,1178],{"class":312},[306,1977,1979,1981,1983,1985,1987],{"class":308,"line":1978},34,[306,1980,398],{"class":312},[306,1982,1790],{"class":341},[306,1984,326],{"class":312},[306,1986,329],{"class":312},[306,1988,1173],{"class":312},[306,1990,1992],{"class":308,"line":1991},35,[306,1993,1801],{"class":312},[306,1995,1997,1999,2001,2003,2005,2007,2010],{"class":308,"line":1996},36,[306,1998,1806],{"class":312},[306,2000,1809],{"class":401},[306,2002,326],{"class":312},[306,2004,329],{"class":312},[306,2006,349],{"class":312},[306,2008,2009],{"class":352},"20210106",[306,2011,569],{"class":312},[306,2013,2015],{"class":308,"line":2014},37,[306,2016,1825],{"class":312},[306,2018,2020],{"class":308,"line":2019},38,[306,2021,1830],{"class":312},[306,2023,2025,2027,2029,2031,2033],{"class":308,"line":2024},39,[306,2026,398],{"class":312},[306,2028,1837],{"class":341},[306,2030,326],{"class":312},[306,2032,329],{"class":312},[306,2034,1173],{"class":312},[306,2036,2038],{"class":308,"line":2037},40,[306,2039,1801],{"class":312},[306,2041,2043,2045,2047,2049,2051,2053,2056],{"class":308,"line":2042},41,[306,2044,1806],{"class":312},[306,2046,1809],{"class":401},[306,2048,326],{"class":312},[306,2050,329],{"class":312},[306,2052,349],{"class":312},[306,2054,2055],{"class":352},"11300",[306,2057,569],{"class":312},[306,2059,2061],{"class":308,"line":2060},42,[306,2062,1825],{"class":312},[306,2064,2066],{"class":308,"line":2065},43,[306,2067,1873],{"class":312},[306,2069,2071],{"class":308,"line":2070},44,[306,2072,1221],{"class":312},[306,2074,2076],{"class":308,"line":2075},45,[306,2077,1226],{"class":312},[306,2079,2081,2083,2086,2088,2090],{"class":308,"line":2080},46,[306,2082,319],{"class":312},[306,2084,2085],{"class":322},"metadata",[306,2087,326],{"class":312},[306,2089,329],{"class":312},[306,2091,2092],{"class":312}," {},\n",[306,2094,2096,2098,2101,2103,2105],{"class":308,"line":2095},47,[306,2097,319],{"class":312},[306,2099,2100],{"class":322},"dimensionHeaders",[306,2102,326],{"class":312},[306,2104,329],{"class":312},[306,2106,1173],{"class":312},[306,2108,2110],{"class":308,"line":2109},48,[306,2111,1178],{"class":312},[306,2113,2115,2117,2119,2121,2123,2125,2127],{"class":308,"line":2114},49,[306,2116,398],{"class":312},[306,2118,1119],{"class":341},[306,2120,326],{"class":312},[306,2122,329],{"class":312},[306,2124,349],{"class":312},[306,2126,1300],{"class":352},[306,2128,569],{"class":312},[306,2130,2132],{"class":308,"line":2131},50,[306,2133,1221],{"class":312},[306,2135,2137],{"class":308,"line":2136},51,[306,2138,1226],{"class":312},[306,2140,2142,2144,2147,2149,2151],{"class":308,"line":2141},52,[306,2143,319],{"class":312},[306,2145,2146],{"class":322},"rowCount",[306,2148,326],{"class":312},[306,2150,329],{"class":312},[306,2152,2153],{"class":401}," 3\n",[306,2155,2157],{"class":308,"line":2156},53,[306,2158,792],{"class":312},[16,2160,2161],{},[1062,2162,2163],{},"The results from UA for comparison:",[296,2165,2167],{"className":298,"code":2166,"language":300,"meta":301,"style":301},"{\n    \"columnHeader\": {\n        \"dimensions\": [\"ga:date\"],\n        \"metricHeader\": {\n            \"metricHeaderEntries\": [{\n                    \"name\": \"ga:sessions\",\n                    \"type\": \"INTEGER\"\n                }\n            ]\n        }\n    },\n    \"data\": {\n        \"rows\": [{\n                \"dimensions\": [\"20210104\"],\n                \"metrics\": [{\n                        \"values\": [\"12900\"]\n                    }\n                ]\n            }, {\n                \"dimensions\": [\"20210105\"],\n                \"metrics\": [{\n                        \"values\": [\"10700\"]\n                    }\n                ]\n            }, {\n                \"dimensions\": [\"20210106\"],\n                \"metrics\": [{\n                        \"values\": [\"11300\"]\n                    }\n                ]\n            }\n        ],\n        \"totals\": [{\n                \"values\": [\"34900\"]\n            }\n        ],\n        \"rowCount\": 3,\n        \"minimums\": [{\n                \"values\": [\"10700\"]\n            }\n        ],\n        \"maximums\": [{\n                \"values\": [\"12900\"]\n            }\n        ]\n    }\n}\n",[303,2168,2169,2173,2186,2206,2219,2234,2253,2270,2275,2280,2284,2288,2301,2313,2334,2346,2368,2373,2378,2385,2405,2417,2437,2441,2445,2451,2471,2483,2503,2507,2511,2516,2521,2534,2555,2559,2563,2578,2591,2611,2615,2619,2632,2652,2656,2661,2665],{"__ignoreMap":301},[306,2170,2171],{"class":308,"line":309},[306,2172,313],{"class":312},[306,2174,2175,2177,2180,2182,2184],{"class":308,"line":316},[306,2176,338],{"class":312},[306,2178,2179],{"class":322},"columnHeader",[306,2181,326],{"class":312},[306,2183,329],{"class":312},[306,2185,332],{"class":312},[306,2187,2188,2190,2192,2194,2196,2198,2200,2202,2204],{"class":308,"line":335},[306,2189,431],{"class":312},[306,2191,1275],{"class":341},[306,2193,326],{"class":312},[306,2195,329],{"class":312},[306,2197,442],{"class":312},[306,2199,326],{"class":312},[306,2201,1568],{"class":352},[306,2203,326],{"class":312},[306,2205,462],{"class":312},[306,2207,2208,2210,2213,2215,2217],{"class":308,"line":361},[306,2209,431],{"class":312},[306,2211,2212],{"class":341},"metricHeader",[306,2214,326],{"class":312},[306,2216,329],{"class":312},[306,2218,332],{"class":312},[306,2220,2221,2224,2227,2229,2231],{"class":308,"line":382},[306,2222,2223],{"class":312},"            \"",[306,2225,2226],{"class":401},"metricHeaderEntries",[306,2228,326],{"class":312},[306,2230,329],{"class":312},[306,2232,2233],{"class":312}," [{\n",[306,2235,2236,2239,2241,2243,2245,2247,2249,2251],{"class":308,"line":395},[306,2237,2238],{"class":312},"                    \"",[306,2240,1119],{"class":434},[306,2242,326],{"class":312},[306,2244,329],{"class":312},[306,2246,349],{"class":312},[306,2248,1511],{"class":352},[306,2250,326],{"class":312},[306,2252,358],{"class":312},[306,2254,2255,2257,2259,2261,2263,2265,2268],{"class":308,"line":414},[306,2256,2238],{"class":312},[306,2258,342],{"class":434},[306,2260,326],{"class":312},[306,2262,329],{"class":312},[306,2264,349],{"class":312},[306,2266,2267],{"class":352},"INTEGER",[306,2269,569],{"class":312},[306,2271,2272],{"class":308,"line":428},[306,2273,2274],{"class":312},"                }\n",[306,2276,2277],{"class":308,"line":465},[306,2278,2279],{"class":312},"            ]\n",[306,2281,2282],{"class":308,"line":498},[306,2283,1825],{"class":312},[306,2285,2286],{"class":308,"line":504},[306,2287,507],{"class":312},[306,2289,2290,2292,2295,2297,2299],{"class":308,"line":510},[306,2291,338],{"class":312},[306,2293,2294],{"class":322},"data",[306,2296,326],{"class":312},[306,2298,329],{"class":312},[306,2300,332],{"class":312},[306,2302,2303,2305,2307,2309,2311],{"class":308,"line":531},[306,2304,431],{"class":312},[306,2306,1773],{"class":341},[306,2308,326],{"class":312},[306,2310,329],{"class":312},[306,2312,2233],{"class":312},[306,2314,2315,2318,2320,2322,2324,2326,2328,2330,2332],{"class":308,"line":552},[306,2316,2317],{"class":312},"                \"",[306,2319,1275],{"class":401},[306,2321,326],{"class":312},[306,2323,329],{"class":312},[306,2325,442],{"class":312},[306,2327,326],{"class":312},[306,2329,1818],{"class":352},[306,2331,326],{"class":312},[306,2333,462],{"class":312},[306,2335,2336,2338,2340,2342,2344],{"class":308,"line":572},[306,2337,2317],{"class":312},[306,2339,1233],{"class":401},[306,2341,326],{"class":312},[306,2343,329],{"class":312},[306,2345,2233],{"class":312},[306,2347,2348,2351,2354,2356,2358,2360,2362,2364,2366],{"class":308,"line":578},[306,2349,2350],{"class":312},"                        \"",[306,2352,2353],{"class":434},"values",[306,2355,326],{"class":312},[306,2357,329],{"class":312},[306,2359,442],{"class":312},[306,2361,326],{"class":312},[306,2363,1862],{"class":352},[306,2365,326],{"class":312},[306,2367,495],{"class":312},[306,2369,2370],{"class":308,"line":592},[306,2371,2372],{"class":312},"                    }\n",[306,2374,2375],{"class":308,"line":613},[306,2376,2377],{"class":312},"                ]\n",[306,2379,2380,2383],{"class":308,"line":634},[306,2381,2382],{"class":312},"            },",[306,2384,332],{"class":312},[306,2386,2387,2389,2391,2393,2395,2397,2399,2401,2403],{"class":308,"line":653},[306,2388,2317],{"class":312},[306,2390,1275],{"class":401},[306,2392,326],{"class":312},[306,2394,329],{"class":312},[306,2396,442],{"class":312},[306,2398,326],{"class":312},[306,2400,1912],{"class":352},[306,2402,326],{"class":312},[306,2404,462],{"class":312},[306,2406,2407,2409,2411,2413,2415],{"class":308,"line":658},[306,2408,2317],{"class":312},[306,2410,1233],{"class":401},[306,2412,326],{"class":312},[306,2414,329],{"class":312},[306,2416,2233],{"class":312},[306,2418,2419,2421,2423,2425,2427,2429,2431,2433,2435],{"class":308,"line":672},[306,2420,2350],{"class":312},[306,2422,2353],{"class":434},[306,2424,326],{"class":312},[306,2426,329],{"class":312},[306,2428,442],{"class":312},[306,2430,326],{"class":312},[306,2432,1953],{"class":352},[306,2434,326],{"class":312},[306,2436,495],{"class":312},[306,2438,2439],{"class":308,"line":693},[306,2440,2372],{"class":312},[306,2442,2443],{"class":308,"line":714},[306,2444,2377],{"class":312},[306,2446,2447,2449],{"class":308,"line":735},[306,2448,2382],{"class":312},[306,2450,332],{"class":312},[306,2452,2453,2455,2457,2459,2461,2463,2465,2467,2469],{"class":308,"line":751},[306,2454,2317],{"class":312},[306,2456,1275],{"class":401},[306,2458,326],{"class":312},[306,2460,329],{"class":312},[306,2462,442],{"class":312},[306,2464,326],{"class":312},[306,2466,2009],{"class":352},[306,2468,326],{"class":312},[306,2470,462],{"class":312},[306,2472,2473,2475,2477,2479,2481],{"class":308,"line":766},[306,2474,2317],{"class":312},[306,2476,1233],{"class":401},[306,2478,326],{"class":312},[306,2480,329],{"class":312},[306,2482,2233],{"class":312},[306,2484,2485,2487,2489,2491,2493,2495,2497,2499,2501],{"class":308,"line":771},[306,2486,2350],{"class":312},[306,2488,2353],{"class":434},[306,2490,326],{"class":312},[306,2492,329],{"class":312},[306,2494,442],{"class":312},[306,2496,326],{"class":312},[306,2498,2055],{"class":352},[306,2500,326],{"class":312},[306,2502,495],{"class":312},[306,2504,2505],{"class":308,"line":789},[306,2506,2372],{"class":312},[306,2508,2509],{"class":308,"line":1958},[306,2510,2377],{"class":312},[306,2512,2513],{"class":308,"line":1963},[306,2514,2515],{"class":312},"            }\n",[306,2517,2518],{"class":308,"line":1968},[306,2519,2520],{"class":312},"        ],\n",[306,2522,2523,2525,2528,2530,2532],{"class":308,"line":1973},[306,2524,431],{"class":312},[306,2526,2527],{"class":341},"totals",[306,2529,326],{"class":312},[306,2531,329],{"class":312},[306,2533,2233],{"class":312},[306,2535,2536,2538,2540,2542,2544,2546,2548,2551,2553],{"class":308,"line":1978},[306,2537,2317],{"class":312},[306,2539,2353],{"class":401},[306,2541,326],{"class":312},[306,2543,329],{"class":312},[306,2545,442],{"class":312},[306,2547,326],{"class":312},[306,2549,2550],{"class":352},"34900",[306,2552,326],{"class":312},[306,2554,495],{"class":312},[306,2556,2557],{"class":308,"line":1991},[306,2558,2515],{"class":312},[306,2560,2561],{"class":308,"line":1996},[306,2562,2520],{"class":312},[306,2564,2565,2567,2569,2571,2573,2576],{"class":308,"line":2014},[306,2566,431],{"class":312},[306,2568,2146],{"class":341},[306,2570,326],{"class":312},[306,2572,329],{"class":312},[306,2574,2575],{"class":401}," 3",[306,2577,358],{"class":312},[306,2579,2580,2582,2585,2587,2589],{"class":308,"line":2019},[306,2581,431],{"class":312},[306,2583,2584],{"class":341},"minimums",[306,2586,326],{"class":312},[306,2588,329],{"class":312},[306,2590,2233],{"class":312},[306,2592,2593,2595,2597,2599,2601,2603,2605,2607,2609],{"class":308,"line":2024},[306,2594,2317],{"class":312},[306,2596,2353],{"class":401},[306,2598,326],{"class":312},[306,2600,329],{"class":312},[306,2602,442],{"class":312},[306,2604,326],{"class":312},[306,2606,1953],{"class":352},[306,2608,326],{"class":312},[306,2610,495],{"class":312},[306,2612,2613],{"class":308,"line":2037},[306,2614,2515],{"class":312},[306,2616,2617],{"class":308,"line":2042},[306,2618,2520],{"class":312},[306,2620,2621,2623,2626,2628,2630],{"class":308,"line":2060},[306,2622,431],{"class":312},[306,2624,2625],{"class":341},"maximums",[306,2627,326],{"class":312},[306,2629,329],{"class":312},[306,2631,2233],{"class":312},[306,2633,2634,2636,2638,2640,2642,2644,2646,2648,2650],{"class":308,"line":2065},[306,2635,2317],{"class":312},[306,2637,2353],{"class":401},[306,2639,326],{"class":312},[306,2641,329],{"class":312},[306,2643,442],{"class":312},[306,2645,326],{"class":312},[306,2647,1862],{"class":352},[306,2649,326],{"class":312},[306,2651,495],{"class":312},[306,2653,2654],{"class":308,"line":2070},[306,2655,2515],{"class":312},[306,2657,2658],{"class":308,"line":2075},[306,2659,2660],{"class":312},"        ]\n",[306,2662,2663],{"class":308,"line":2080},[306,2664,1221],{"class":312},[306,2666,2667],{"class":308,"line":2095},[306,2668,792],{"class":312},[16,2670,2671],{},"Overall, as you can see in the included example the structure of both the query and the resulting response is very similar with some steps towards consistency between dimensions’ and metrics’ specification and presentation. Therefore, there does not seem to be an obstacle from moving from simple queries in the original API to the simple queries in the GA4 API. So, let us investigate what the GA4 API brings additionally.",[11,2673,2675],{"id":2674},"further-parameters-in-a-single-query","Further parameters in a single query",[61,2677,2679],{"id":2678},"quotas-report","Quotas report",[16,2681,2682],{},"One of the new features offered by the GA4 API is the option to view the quotas for a given property. This information serves as a warning if you are nearing any of the thresholds or for informative purposes about the number of tokens consumed by a given request because requests in GA4 API cost a different amount of tokens based on their complexity. If you run too many complex requests, you will reach the limit of your available quotas and may need to wait for the next hour or the next day, depending on the type of quota you have reached.",[16,2684,2685,2686,2689,2690,2693,2694,2697,2698,2701,2702,2705,2706,2709],{},"The quotas information can be received by setting the optional parameter ",[303,2687,2688],{},"returnPropertyQuotas"," to true. This results in an additional object in the results added on the same level as rows or headers. The results contain 5 quotas information. First, they inform you about the number of ",[265,2691,2692],{},"tokens consumed"," by the current query ",[265,2695,2696],{},"and remaining"," tokens per day and per hour. According to the quotas report in the included example, standard property has in total 25,000 tokens per day and 5,000 tokens per hour available for the GA4 API. The current request that queried this information along with other data consumed 5 tokens from the limits. Additionally, it provides information about the remaining ",[265,2699,2700],{},"permitted concurrent requests"," and ",[265,2703,2704],{},"permitted server errors"," for the given project. There can be only 10 requests running in parallel and there can be no more than 10 server errors (responses with code 500 or 503) in an hour for the whole project, otherwise, Google allows no further queries to be processed until the hour passes. Lastly, up to 120 requests with ",[265,2707,2708],{},"potentially thresholded dimensions"," per hour are allowed. Aomng the potentially thresholded dimensions belongs userAgeBracket, userGender, brandingInterest, audienceId, and audienceName. This limit is imposed to prevent inference of user demographics or interests.",[296,2711,2713],{"className":298,"code":2712,"language":300,"meta":301,"style":301},"        \"propertyQuota\": {\n            \"tokensPerDay\": {\n                \"consumed\": 5,\n                \"remaining\": 24986\n            },\n            \"tokensPerHour\": {\n                \"consumed\": 5,\n                \"remaining\": 4990\n            },\n            \"concurrentRequests\": {\n                \"remaining\": 10\n            },\n            \"serverErrorsPerProjectPerHour\": {\n                \"remaining\": 10\n            },\n            \"potentiallyThresholdedRequestsPerHour\": {\n                \"remaining\": 120\n            }\n        }\n",[303,2714,2715,2730,2743,2759,2773,2778,2791,2805,2818,2822,2835,2848,2852,2865,2877,2881,2894,2907,2911],{"__ignoreMap":301},[306,2716,2717,2719,2722,2724,2728],{"class":308,"line":309},[306,2718,431],{"class":312},[306,2720,2721],{"class":352},"propertyQuota",[306,2723,326],{"class":312},[306,2725,2727],{"class":2726},"s0W1g",": ",[306,2729,313],{"class":312},[306,2731,2732,2734,2737,2739,2741],{"class":308,"line":316},[306,2733,2223],{"class":312},[306,2735,2736],{"class":322},"tokensPerDay",[306,2738,326],{"class":312},[306,2740,329],{"class":312},[306,2742,332],{"class":312},[306,2744,2745,2747,2750,2752,2754,2757],{"class":308,"line":335},[306,2746,2317],{"class":312},[306,2748,2749],{"class":341},"consumed",[306,2751,326],{"class":312},[306,2753,329],{"class":312},[306,2755,2756],{"class":401}," 5",[306,2758,358],{"class":312},[306,2760,2761,2763,2766,2768,2770],{"class":308,"line":361},[306,2762,2317],{"class":312},[306,2764,2765],{"class":341},"remaining",[306,2767,326],{"class":312},[306,2769,329],{"class":312},[306,2771,2772],{"class":401}," 24986\n",[306,2774,2775],{"class":308,"line":382},[306,2776,2777],{"class":312},"            },\n",[306,2779,2780,2782,2785,2787,2789],{"class":308,"line":395},[306,2781,2223],{"class":312},[306,2783,2784],{"class":322},"tokensPerHour",[306,2786,326],{"class":312},[306,2788,329],{"class":312},[306,2790,332],{"class":312},[306,2792,2793,2795,2797,2799,2801,2803],{"class":308,"line":414},[306,2794,2317],{"class":312},[306,2796,2749],{"class":341},[306,2798,326],{"class":312},[306,2800,329],{"class":312},[306,2802,2756],{"class":401},[306,2804,358],{"class":312},[306,2806,2807,2809,2811,2813,2815],{"class":308,"line":428},[306,2808,2317],{"class":312},[306,2810,2765],{"class":341},[306,2812,326],{"class":312},[306,2814,329],{"class":312},[306,2816,2817],{"class":401}," 4990\n",[306,2819,2820],{"class":308,"line":465},[306,2821,2777],{"class":312},[306,2823,2824,2826,2829,2831,2833],{"class":308,"line":498},[306,2825,2223],{"class":312},[306,2827,2828],{"class":322},"concurrentRequests",[306,2830,326],{"class":312},[306,2832,329],{"class":312},[306,2834,332],{"class":312},[306,2836,2837,2839,2841,2843,2845],{"class":308,"line":504},[306,2838,2317],{"class":312},[306,2840,2765],{"class":341},[306,2842,326],{"class":312},[306,2844,329],{"class":312},[306,2846,2847],{"class":401}," 10\n",[306,2849,2850],{"class":308,"line":510},[306,2851,2777],{"class":312},[306,2853,2854,2856,2859,2861,2863],{"class":308,"line":531},[306,2855,2223],{"class":312},[306,2857,2858],{"class":322},"serverErrorsPerProjectPerHour",[306,2860,326],{"class":312},[306,2862,329],{"class":312},[306,2864,332],{"class":312},[306,2866,2867,2869,2871,2873,2875],{"class":308,"line":552},[306,2868,2317],{"class":312},[306,2870,2765],{"class":341},[306,2872,326],{"class":312},[306,2874,329],{"class":312},[306,2876,2847],{"class":401},[306,2878,2879],{"class":308,"line":572},[306,2880,2777],{"class":312},[306,2882,2883,2885,2888,2890,2892],{"class":308,"line":578},[306,2884,2223],{"class":312},[306,2886,2887],{"class":322},"potentiallyThresholdedRequestsPerHour",[306,2889,326],{"class":312},[306,2891,329],{"class":312},[306,2893,332],{"class":312},[306,2895,2896,2898,2900,2902,2904],{"class":308,"line":592},[306,2897,2317],{"class":312},[306,2899,2765],{"class":341},[306,2901,326],{"class":312},[306,2903,329],{"class":312},[306,2905,2906],{"class":401}," 120\n",[306,2908,2909],{"class":308,"line":613},[306,2910,2515],{"class":312},[306,2912,2913],{"class":308,"line":634},[306,2914,1825],{"class":312},[61,2916,2918],{"id":2917},"notes-on-filters","Notes on filters",[16,2920,2921,2922,2925],{},"Next, we include a comment on the filters in the GA4 API. The filters for metrics and dimensions are separated in the same way as for the original API. There is no ",[303,2923,2924],{},"filtersExpression"," parameter that would allow simple filters to be written in one line.",[16,2927,2928,2929,2932,2933,2936,2937,1674,2940,2701,2943,2946],{},"However, the dimension and metric filters are now much more flexible regarding combinations of multiple filters together. In the original API, you could combine multiple filters on only one level, specifying that either all filters should hold (using the ",[303,2930,2931],{},"and"," operator) or that it is sufficient for only one of the filters to be satisfied (using the ",[303,2934,2935],{},"or"," operator). In the GA4 API, there is an option to chain several of these operators using a set of the following parameters successively: ",[303,2938,2939],{},"andGroup",[303,2941,2942],{},"orGroup",[303,2944,2945],{},"notExpression",". For example, if you need to analyze multiple groups of visitors or events where at least one group is specified by more than one condition (e.g. people who visited a certain page using a mobile phone or when an error occurred for people coming from a particular source), you can easily do it in the GA4 API while you would need separate requests using the original API.",[16,2948,2949],{},"Below you can find an example of the dimension filter with multiple chained conditions. This query can be used to checking multiple reported device-specific events at once. The conditions can be simplified into:",[2951,2952,2953,2956,2959,2960,2962,2965,2967,2968,2970,2973],"example",{},[265,2954,2955],{},"Example",[2957,2958],"br",{},"\n\n\nEITHER\n",[2957,2961],{},[303,2963,2964],{},"(deviceCategory == \"Mobile\" AND pagePath == \"\u002Fpath-to-page\")",[2957,2966],{},"\n\n\nOR\n",[2957,2969],{},[303,2971,2972],{},"(deviceCategory == \"Tablet\" AND pagePath == \"\u002Fpath-to-another-page\")",[2957,2974],{},[296,2976,2978],{"className":298,"code":2977,"language":300,"meta":301,"style":301},"{\n    \"dimensionFilter\": {\n      \"orGroup\": {\n        \"expressions\": [\n          {\n            \"andGroup\": {\n              \"expressions\": [\n                {\n                  \"filter\": {\n                    \"stringFilter\": {\n                      \"value\": \"Mobile\"\n                    },\n                    \"fieldName\": \"deviceCategory\"\n                  }\n                },\n                {\n                  \"filter\": {\n                    \"stringFilter\": {\n                      \"value\": \"\u002Fpath-to-page\"\n                    },\n                    \"fieldName\": \"pagePath\"\n                  }\n                }\n              ]\n            }\n          }, \n        {\n            \"andGroup\": {\n              \"expressions\": [\n                {\n                  \"filter\": {\n                    \"stringFilter\": {\n                      \"value\": \"Tablet\"\n                    },\n                    \"fieldName\": \"deviceCategory\"\n                  }\n                },\n                {\n                  \"filter\": {\n                    \"stringFilter\": {\n                      \"value\": \"\u002Fpath-to-different-page\"\n                    },\n                    \"fieldName\": \"pagePath\"\n                  }\n                }\n              ]\n            }\n          }\n        ]\n      }\n    }\n  }\n",[303,2979,2980,2984,2997,3009,3022,3027,3039,3053,3058,3073,3087,3105,3110,3127,3132,3137,3141,3153,3165,3182,3186,3203,3207,3211,3216,3220,3228,3232,3244,3256,3260,3272,3284,3301,3305,3321,3325,3329,3333,3345,3357,3374,3378,3394,3398,3402,3406,3410,3415,3419,3423,3427],{"__ignoreMap":301},[306,2981,2982],{"class":308,"line":309},[306,2983,313],{"class":312},[306,2985,2986,2988,2991,2993,2995],{"class":308,"line":316},[306,2987,338],{"class":312},[306,2989,2990],{"class":322},"dimensionFilter",[306,2992,326],{"class":312},[306,2994,329],{"class":312},[306,2996,332],{"class":312},[306,2998,2999,3001,3003,3005,3007],{"class":308,"line":335},[306,3000,398],{"class":312},[306,3002,2942],{"class":341},[306,3004,326],{"class":312},[306,3006,329],{"class":312},[306,3008,332],{"class":312},[306,3010,3011,3013,3016,3018,3020],{"class":308,"line":361},[306,3012,431],{"class":312},[306,3014,3015],{"class":401},"expressions",[306,3017,326],{"class":312},[306,3019,329],{"class":312},[306,3021,1173],{"class":312},[306,3023,3024],{"class":308,"line":382},[306,3025,3026],{"class":312},"          {\n",[306,3028,3029,3031,3033,3035,3037],{"class":308,"line":395},[306,3030,2223],{"class":312},[306,3032,2939],{"class":434},[306,3034,326],{"class":312},[306,3036,329],{"class":312},[306,3038,332],{"class":312},[306,3040,3041,3044,3047,3049,3051],{"class":308,"line":414},[306,3042,3043],{"class":312},"              \"",[306,3045,3015],{"class":3046},"s9WhI",[306,3048,326],{"class":312},[306,3050,329],{"class":312},[306,3052,1173],{"class":312},[306,3054,3055],{"class":308,"line":428},[306,3056,3057],{"class":312},"                {\n",[306,3059,3060,3063,3067,3069,3071],{"class":308,"line":465},[306,3061,3062],{"class":312},"                  \"",[306,3064,3066],{"class":3065},"sdLwU","filter",[306,3068,326],{"class":312},[306,3070,329],{"class":312},[306,3072,332],{"class":312},[306,3074,3075,3077,3081,3083,3085],{"class":308,"line":498},[306,3076,2238],{"class":312},[306,3078,3080],{"class":3079},"sbqyR","stringFilter",[306,3082,326],{"class":312},[306,3084,329],{"class":312},[306,3086,332],{"class":312},[306,3088,3089,3092,3094,3096,3098,3100,3103],{"class":308,"line":504},[306,3090,3091],{"class":312},"                      \"",[306,3093,1809],{"class":322},[306,3095,326],{"class":312},[306,3097,329],{"class":312},[306,3099,349],{"class":312},[306,3101,3102],{"class":352},"Mobile",[306,3104,569],{"class":312},[306,3106,3107],{"class":308,"line":510},[306,3108,3109],{"class":312},"                    },\n",[306,3111,3112,3114,3116,3118,3120,3122,3125],{"class":308,"line":531},[306,3113,2238],{"class":312},[306,3115,1621],{"class":3079},[306,3117,326],{"class":312},[306,3119,329],{"class":312},[306,3121,349],{"class":312},[306,3123,3124],{"class":352},"deviceCategory",[306,3126,569],{"class":312},[306,3128,3129],{"class":308,"line":552},[306,3130,3131],{"class":312},"                  }\n",[306,3133,3134],{"class":308,"line":572},[306,3135,3136],{"class":312},"                },\n",[306,3138,3139],{"class":308,"line":578},[306,3140,3057],{"class":312},[306,3142,3143,3145,3147,3149,3151],{"class":308,"line":592},[306,3144,3062],{"class":312},[306,3146,3066],{"class":3065},[306,3148,326],{"class":312},[306,3150,329],{"class":312},[306,3152,332],{"class":312},[306,3154,3155,3157,3159,3161,3163],{"class":308,"line":613},[306,3156,2238],{"class":312},[306,3158,3080],{"class":3079},[306,3160,326],{"class":312},[306,3162,329],{"class":312},[306,3164,332],{"class":312},[306,3166,3167,3169,3171,3173,3175,3177,3180],{"class":308,"line":634},[306,3168,3091],{"class":312},[306,3170,1809],{"class":322},[306,3172,326],{"class":312},[306,3174,329],{"class":312},[306,3176,349],{"class":312},[306,3178,3179],{"class":352},"\u002Fpath-to-page",[306,3181,569],{"class":312},[306,3183,3184],{"class":308,"line":653},[306,3185,3109],{"class":312},[306,3187,3188,3190,3192,3194,3196,3198,3201],{"class":308,"line":658},[306,3189,2238],{"class":312},[306,3191,1621],{"class":3079},[306,3193,326],{"class":312},[306,3195,329],{"class":312},[306,3197,349],{"class":312},[306,3199,3200],{"class":352},"pagePath",[306,3202,569],{"class":312},[306,3204,3205],{"class":308,"line":672},[306,3206,3131],{"class":312},[306,3208,3209],{"class":308,"line":693},[306,3210,2274],{"class":312},[306,3212,3213],{"class":308,"line":714},[306,3214,3215],{"class":312},"              ]\n",[306,3217,3218],{"class":308,"line":735},[306,3219,2515],{"class":312},[306,3221,3222,3225],{"class":308,"line":751},[306,3223,3224],{"class":312},"          },",[306,3226,3227],{"class":2726}," \n",[306,3229,3230],{"class":308,"line":766},[306,3231,1801],{"class":312},[306,3233,3234,3236,3238,3240,3242],{"class":308,"line":771},[306,3235,2223],{"class":312},[306,3237,2939],{"class":434},[306,3239,326],{"class":312},[306,3241,329],{"class":312},[306,3243,332],{"class":312},[306,3245,3246,3248,3250,3252,3254],{"class":308,"line":789},[306,3247,3043],{"class":312},[306,3249,3015],{"class":3046},[306,3251,326],{"class":312},[306,3253,329],{"class":312},[306,3255,1173],{"class":312},[306,3257,3258],{"class":308,"line":1958},[306,3259,3057],{"class":312},[306,3261,3262,3264,3266,3268,3270],{"class":308,"line":1963},[306,3263,3062],{"class":312},[306,3265,3066],{"class":3065},[306,3267,326],{"class":312},[306,3269,329],{"class":312},[306,3271,332],{"class":312},[306,3273,3274,3276,3278,3280,3282],{"class":308,"line":1968},[306,3275,2238],{"class":312},[306,3277,3080],{"class":3079},[306,3279,326],{"class":312},[306,3281,329],{"class":312},[306,3283,332],{"class":312},[306,3285,3286,3288,3290,3292,3294,3296,3299],{"class":308,"line":1973},[306,3287,3091],{"class":312},[306,3289,1809],{"class":322},[306,3291,326],{"class":312},[306,3293,329],{"class":312},[306,3295,349],{"class":312},[306,3297,3298],{"class":352},"Tablet",[306,3300,569],{"class":312},[306,3302,3303],{"class":308,"line":1978},[306,3304,3109],{"class":312},[306,3306,3307,3309,3311,3313,3315,3317,3319],{"class":308,"line":1991},[306,3308,2238],{"class":312},[306,3310,1621],{"class":3079},[306,3312,326],{"class":312},[306,3314,329],{"class":312},[306,3316,349],{"class":312},[306,3318,3124],{"class":352},[306,3320,569],{"class":312},[306,3322,3323],{"class":308,"line":1996},[306,3324,3131],{"class":312},[306,3326,3327],{"class":308,"line":2014},[306,3328,3136],{"class":312},[306,3330,3331],{"class":308,"line":2019},[306,3332,3057],{"class":312},[306,3334,3335,3337,3339,3341,3343],{"class":308,"line":2024},[306,3336,3062],{"class":312},[306,3338,3066],{"class":3065},[306,3340,326],{"class":312},[306,3342,329],{"class":312},[306,3344,332],{"class":312},[306,3346,3347,3349,3351,3353,3355],{"class":308,"line":2037},[306,3348,2238],{"class":312},[306,3350,3080],{"class":3079},[306,3352,326],{"class":312},[306,3354,329],{"class":312},[306,3356,332],{"class":312},[306,3358,3359,3361,3363,3365,3367,3369,3372],{"class":308,"line":2042},[306,3360,3091],{"class":312},[306,3362,1809],{"class":322},[306,3364,326],{"class":312},[306,3366,329],{"class":312},[306,3368,349],{"class":312},[306,3370,3371],{"class":352},"\u002Fpath-to-different-page",[306,3373,569],{"class":312},[306,3375,3376],{"class":308,"line":2060},[306,3377,3109],{"class":312},[306,3379,3380,3382,3384,3386,3388,3390,3392],{"class":308,"line":2065},[306,3381,2238],{"class":312},[306,3383,1621],{"class":3079},[306,3385,326],{"class":312},[306,3387,329],{"class":312},[306,3389,349],{"class":312},[306,3391,3200],{"class":352},[306,3393,569],{"class":312},[306,3395,3396],{"class":308,"line":2070},[306,3397,3131],{"class":312},[306,3399,3400],{"class":308,"line":2075},[306,3401,2274],{"class":312},[306,3403,3404],{"class":308,"line":2080},[306,3405,3215],{"class":312},[306,3407,3408],{"class":308,"line":2095},[306,3409,2515],{"class":312},[306,3411,3412],{"class":308,"line":2109},[306,3413,3414],{"class":312},"          }\n",[306,3416,3417],{"class":308,"line":2114},[306,3418,2660],{"class":312},[306,3420,3421],{"class":308,"line":2131},[306,3422,501],{"class":312},[306,3424,3425],{"class":308,"line":2136},[306,3426,1221],{"class":312},[306,3428,3429],{"class":308,"line":2141},[306,3430,3431],{"class":312},"  }\n",[16,3433,3434,3435,1674,3438,1674,3440,1674,3443,2701,3446,3449,3450,2701,3452,3454,3455,3457,3458,3460],{},"For the individual dimension or metric filter there are several options for filter types: ",[303,3436,3437],{},"nullFilter",[303,3439,3080],{},[303,3441,3442],{},"inListFilter",[303,3444,3445],{},"numericFilter",[303,3447,3448],{},"betweenFilter",". While these are not entirely innovative, they present a more systematic way of selecting the type by separating ",[303,3451,3442],{},[303,3453,3448],{}," from the classical numeric and string filters. The ",[303,3456,3437],{}," offers an option to check for null values in a dimension. It can be accompanied by ",[303,3459,2945],{}," to exclude all rows with null values in a certain dimension.",[61,3462,3464],{"id":3463},"cohorts","Cohorts",[16,3466,3467,3468,3472,3473,3476,3477,3479],{},"Cohorts were possible to analyze already in the original API. To learn more about that, check our article on extended options in the ",[1049,3469,3471],{"href":1051,"rel":3470},[1053],"original API version v4",". The options to run cohort report requests haven’t changed so much yet. It is still only possible to define a cohort by the time of their first visit, by setting the cohort dimension to ",[303,3474,3475],{},"firstTouchDate",". You further specify a name to denote the cohort group and the date range for the ",[303,3478,3475],{}," that defines the cohort.",[16,3481,3482],{},"An improvement over the previous state is the flexibility to define the period for which the cohort should be observed. Unlike before, you specify the granularity of the report, and by setting the start and end offset and choose for how many of these granularity time periods the report should extend. The original API selects the observation period for you automatically.",[16,3484,3485],{},"We show an example of how you can compare weekly cohorts that come first in various weeks before Christmas and determine whether the people that come closer before Christmas stay active in a similar proportion to people who come long before Christmas. The query asks for the proportion of active users several weeks after their first visit. The results contain data for users with first visits in one of the three selected weeks (second week of October, the second week of November, and second week of December). You can see how many of them returned one to four weeks after their first visit where the weeks are depicted on the horizontal axis and the returning share on the vertical axis. As you can see from the graph, there is a difference between people from the selected weeks. In this case, people with first visits closer to Christmas came in a higher share in the next week, however, in the longer term, they have a lower retention rate.",[16,3487,3488],{},[3489,3490],"img",{"alt":301,"src":3491,"title":3492},"\u002Fupload\u002Fcohort.webp","Cohort Comparison",[296,3494,3496],{"className":298,"code":3495,"language":300,"meta":301,"style":301},"    {\n        \"dimensions\": [\n            {\n                \"name\": \"cohort\"\n            },\n            {\n                \"name\": \"cohortNthWeek\"\n            }\n        ],\n        \"metrics\": [\n        {\n          \"name\": \"cohortRetentionFraction\",\n          \"expression\": \"cohortActiveUsers\u002FcohortTotalUsers\"\n        }\n      ],\n        \"cohortSpec\": {\n            \"cohorts\": [\n                {\n                    \"name\": \"20-10-02\",\n                    \"dimension\": \"firstTouchDate\",\n                    \"dateRange\": {\n                        \"startDate\": \"2020-10-05\",\n                        \"endDate\": \"2020-10-11\"\n                    }\n                },\n                {\n                    \"name\": \"20-11-02\",\n                    \"dimension\": \"firstTouchDate\",\n                    \"dateRange\": {\n                        \"startDate\": \"2020-11-09\",\n                        \"endDate\": \"2020-11-15\"\n                    }\n                },\n                {\n                    \"name\": \"20-12-02\",\n                    \"dimension\": \"firstTouchDate\",\n                    \"dateRange\": {\n                        \"startDate\": \"2020-12-08\",\n                        \"endDate\": \"2020-12-14\"\n                    }\n                }\n            ],\n            \"cohortsRange\": {\n                \"granularity\": \"WEEKLY\",\n                \"startOffset\": 0,\n                \"endOffset\": 4\n            }\n        }\n    }\n",[303,3497,3498,3502,3514,3519,3536,3540,3544,3561,3565,3569,3581,3585,3604,3621,3625,3629,3642,3654,3658,3677,3696,3709,3728,3745,3749,3753,3757,3776,3794,3806,3825,3842,3846,3850,3854,3873,3891,3903,3922,3939,3943,3947,3952,3965,3985,4001,4015,4019,4023],{"__ignoreMap":301},[306,3499,3500],{"class":308,"line":309},[306,3501,1178],{"class":312},[306,3503,3504,3506,3508,3510,3512],{"class":308,"line":316},[306,3505,431],{"class":312},[306,3507,1275],{"class":322},[306,3509,326],{"class":312},[306,3511,329],{"class":312},[306,3513,1173],{"class":312},[306,3515,3516],{"class":308,"line":335},[306,3517,3518],{"class":312},"            {\n",[306,3520,3521,3523,3525,3527,3529,3531,3534],{"class":308,"line":361},[306,3522,2317],{"class":312},[306,3524,1119],{"class":341},[306,3526,326],{"class":312},[306,3528,329],{"class":312},[306,3530,349],{"class":312},[306,3532,3533],{"class":352},"cohort",[306,3535,569],{"class":312},[306,3537,3538],{"class":308,"line":382},[306,3539,2777],{"class":312},[306,3541,3542],{"class":308,"line":395},[306,3543,3518],{"class":312},[306,3545,3546,3548,3550,3552,3554,3556,3559],{"class":308,"line":414},[306,3547,2317],{"class":312},[306,3549,1119],{"class":341},[306,3551,326],{"class":312},[306,3553,329],{"class":312},[306,3555,349],{"class":312},[306,3557,3558],{"class":352},"cohortNthWeek",[306,3560,569],{"class":312},[306,3562,3563],{"class":308,"line":428},[306,3564,2515],{"class":312},[306,3566,3567],{"class":308,"line":465},[306,3568,2520],{"class":312},[306,3570,3571,3573,3575,3577,3579],{"class":308,"line":498},[306,3572,431],{"class":312},[306,3574,1233],{"class":322},[306,3576,326],{"class":312},[306,3578,329],{"class":312},[306,3580,1173],{"class":312},[306,3582,3583],{"class":308,"line":504},[306,3584,1801],{"class":312},[306,3586,3587,3589,3591,3593,3595,3597,3600,3602],{"class":308,"line":510},[306,3588,1806],{"class":312},[306,3590,1119],{"class":341},[306,3592,326],{"class":312},[306,3594,329],{"class":312},[306,3596,349],{"class":312},[306,3598,3599],{"class":352},"cohortRetentionFraction",[306,3601,326],{"class":312},[306,3603,358],{"class":312},[306,3605,3606,3608,3610,3612,3614,3616,3619],{"class":308,"line":531},[306,3607,1806],{"class":312},[306,3609,1123],{"class":341},[306,3611,326],{"class":312},[306,3613,329],{"class":312},[306,3615,349],{"class":312},[306,3617,3618],{"class":352},"cohortActiveUsers\u002FcohortTotalUsers",[306,3620,569],{"class":312},[306,3622,3623],{"class":308,"line":552},[306,3624,1825],{"class":312},[306,3626,3627],{"class":308,"line":572},[306,3628,1830],{"class":312},[306,3630,3631,3633,3636,3638,3640],{"class":308,"line":578},[306,3632,431],{"class":312},[306,3634,3635],{"class":322},"cohortSpec",[306,3637,326],{"class":312},[306,3639,329],{"class":312},[306,3641,332],{"class":312},[306,3643,3644,3646,3648,3650,3652],{"class":308,"line":592},[306,3645,2223],{"class":312},[306,3647,3463],{"class":341},[306,3649,326],{"class":312},[306,3651,329],{"class":312},[306,3653,1173],{"class":312},[306,3655,3656],{"class":308,"line":613},[306,3657,3057],{"class":312},[306,3659,3660,3662,3664,3666,3668,3670,3673,3675],{"class":308,"line":634},[306,3661,2238],{"class":312},[306,3663,1119],{"class":401},[306,3665,326],{"class":312},[306,3667,329],{"class":312},[306,3669,349],{"class":312},[306,3671,3672],{"class":352},"20-10-02",[306,3674,326],{"class":312},[306,3676,358],{"class":312},[306,3678,3679,3681,3684,3686,3688,3690,3692,3694],{"class":308,"line":653},[306,3680,2238],{"class":312},[306,3682,3683],{"class":401},"dimension",[306,3685,326],{"class":312},[306,3687,329],{"class":312},[306,3689,349],{"class":312},[306,3691,3475],{"class":352},[306,3693,326],{"class":312},[306,3695,358],{"class":312},[306,3697,3698,3700,3703,3705,3707],{"class":308,"line":658},[306,3699,2238],{"class":312},[306,3701,3702],{"class":401},"dateRange",[306,3704,326],{"class":312},[306,3706,329],{"class":312},[306,3708,332],{"class":312},[306,3710,3711,3713,3715,3717,3719,3721,3724,3726],{"class":308,"line":672},[306,3712,2350],{"class":312},[306,3714,1185],{"class":434},[306,3716,326],{"class":312},[306,3718,329],{"class":312},[306,3720,349],{"class":312},[306,3722,3723],{"class":352},"2020-10-05",[306,3725,326],{"class":312},[306,3727,358],{"class":312},[306,3729,3730,3732,3734,3736,3738,3740,3743],{"class":308,"line":693},[306,3731,2350],{"class":312},[306,3733,1205],{"class":434},[306,3735,326],{"class":312},[306,3737,329],{"class":312},[306,3739,349],{"class":312},[306,3741,3742],{"class":352},"2020-10-11",[306,3744,569],{"class":312},[306,3746,3747],{"class":308,"line":714},[306,3748,2372],{"class":312},[306,3750,3751],{"class":308,"line":735},[306,3752,3136],{"class":312},[306,3754,3755],{"class":308,"line":751},[306,3756,3057],{"class":312},[306,3758,3759,3761,3763,3765,3767,3769,3772,3774],{"class":308,"line":766},[306,3760,2238],{"class":312},[306,3762,1119],{"class":401},[306,3764,326],{"class":312},[306,3766,329],{"class":312},[306,3768,349],{"class":312},[306,3770,3771],{"class":352},"20-11-02",[306,3773,326],{"class":312},[306,3775,358],{"class":312},[306,3777,3778,3780,3782,3784,3786,3788,3790,3792],{"class":308,"line":771},[306,3779,2238],{"class":312},[306,3781,3683],{"class":401},[306,3783,326],{"class":312},[306,3785,329],{"class":312},[306,3787,349],{"class":312},[306,3789,3475],{"class":352},[306,3791,326],{"class":312},[306,3793,358],{"class":312},[306,3795,3796,3798,3800,3802,3804],{"class":308,"line":789},[306,3797,2238],{"class":312},[306,3799,3702],{"class":401},[306,3801,326],{"class":312},[306,3803,329],{"class":312},[306,3805,332],{"class":312},[306,3807,3808,3810,3812,3814,3816,3818,3821,3823],{"class":308,"line":1958},[306,3809,2350],{"class":312},[306,3811,1185],{"class":434},[306,3813,326],{"class":312},[306,3815,329],{"class":312},[306,3817,349],{"class":312},[306,3819,3820],{"class":352},"2020-11-09",[306,3822,326],{"class":312},[306,3824,358],{"class":312},[306,3826,3827,3829,3831,3833,3835,3837,3840],{"class":308,"line":1963},[306,3828,2350],{"class":312},[306,3830,1205],{"class":434},[306,3832,326],{"class":312},[306,3834,329],{"class":312},[306,3836,349],{"class":312},[306,3838,3839],{"class":352},"2020-11-15",[306,3841,569],{"class":312},[306,3843,3844],{"class":308,"line":1968},[306,3845,2372],{"class":312},[306,3847,3848],{"class":308,"line":1973},[306,3849,3136],{"class":312},[306,3851,3852],{"class":308,"line":1978},[306,3853,3057],{"class":312},[306,3855,3856,3858,3860,3862,3864,3866,3869,3871],{"class":308,"line":1991},[306,3857,2238],{"class":312},[306,3859,1119],{"class":401},[306,3861,326],{"class":312},[306,3863,329],{"class":312},[306,3865,349],{"class":312},[306,3867,3868],{"class":352},"20-12-02",[306,3870,326],{"class":312},[306,3872,358],{"class":312},[306,3874,3875,3877,3879,3881,3883,3885,3887,3889],{"class":308,"line":1996},[306,3876,2238],{"class":312},[306,3878,3683],{"class":401},[306,3880,326],{"class":312},[306,3882,329],{"class":312},[306,3884,349],{"class":312},[306,3886,3475],{"class":352},[306,3888,326],{"class":312},[306,3890,358],{"class":312},[306,3892,3893,3895,3897,3899,3901],{"class":308,"line":2014},[306,3894,2238],{"class":312},[306,3896,3702],{"class":401},[306,3898,326],{"class":312},[306,3900,329],{"class":312},[306,3902,332],{"class":312},[306,3904,3905,3907,3909,3911,3913,3915,3918,3920],{"class":308,"line":2019},[306,3906,2350],{"class":312},[306,3908,1185],{"class":434},[306,3910,326],{"class":312},[306,3912,329],{"class":312},[306,3914,349],{"class":312},[306,3916,3917],{"class":352},"2020-12-08",[306,3919,326],{"class":312},[306,3921,358],{"class":312},[306,3923,3924,3926,3928,3930,3932,3934,3937],{"class":308,"line":2024},[306,3925,2350],{"class":312},[306,3927,1205],{"class":434},[306,3929,326],{"class":312},[306,3931,329],{"class":312},[306,3933,349],{"class":312},[306,3935,3936],{"class":352},"2020-12-14",[306,3938,569],{"class":312},[306,3940,3941],{"class":308,"line":2037},[306,3942,2372],{"class":312},[306,3944,3945],{"class":308,"line":2042},[306,3946,2274],{"class":312},[306,3948,3949],{"class":308,"line":2060},[306,3950,3951],{"class":312},"            ],\n",[306,3953,3954,3956,3959,3961,3963],{"class":308,"line":2065},[306,3955,2223],{"class":312},[306,3957,3958],{"class":341},"cohortsRange",[306,3960,326],{"class":312},[306,3962,329],{"class":312},[306,3964,332],{"class":312},[306,3966,3967,3969,3972,3974,3976,3978,3981,3983],{"class":308,"line":2070},[306,3968,2317],{"class":312},[306,3970,3971],{"class":401},"granularity",[306,3973,326],{"class":312},[306,3975,329],{"class":312},[306,3977,349],{"class":312},[306,3979,3980],{"class":352},"WEEKLY",[306,3982,326],{"class":312},[306,3984,358],{"class":312},[306,3986,3987,3989,3992,3994,3996,3999],{"class":308,"line":2075},[306,3988,2317],{"class":312},[306,3990,3991],{"class":401},"startOffset",[306,3993,326],{"class":312},[306,3995,329],{"class":312},[306,3997,3998],{"class":401}," 0",[306,4000,358],{"class":312},[306,4002,4003,4005,4008,4010,4012],{"class":308,"line":2080},[306,4004,2317],{"class":312},[306,4006,4007],{"class":401},"endOffset",[306,4009,326],{"class":312},[306,4011,329],{"class":312},[306,4013,4014],{"class":401}," 4\n",[306,4016,4017],{"class":308,"line":2095},[306,4018,2515],{"class":312},[306,4020,4021],{"class":308,"line":2109},[306,4022,1825],{"class":312},[306,4024,4025],{"class":308,"line":2114},[306,4026,1221],{"class":312},[16,4028,4029,4030,4035],{},"For more examples, ",[1049,4031,4034],{"href":4032,"rel":4033},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Fadvanced#cohort_report_examples",[1053],"Google provides"," sample queries with explanations and visual representation.",[61,4037,4039],{"id":4038},"pagination","Pagination",[16,4041,4042,4043,4046,4047,4050,4051,4053],{},"By default, the query returns (up to) 10 rows of the results. This can be increased using the limit parameter of up to 10,000 rows of returned results. If you need to query more rows, you can combine the ",[303,4044,4045],{},"limit"," parameter with the parameter ",[303,4048,4049],{},"offset"," which specifies from which index the results should be displayed. Therefore, if the ",[303,4052,2146],{}," in the results show that you have over 10,000 resulting rows, you need to run the query first with the following parameters to query the first 10,000 rows:",[16,4055,4056],{},[303,4057,4058],{},"{… \"limit\": 10000, \"offset\": 0}",[16,4060,4061],{},"and next, with offset set to 10,000 to query rows starting with the row index 10,001:",[16,4063,4064],{},[303,4065,4066],{},"{… \"limit\": 10000, \"offset\": 10000}",[11,4068,4070],{"id":4069},"multiple-queries","Multiple queries",[16,4072,4073,4074,4077,4078,4080],{},"To run multiple requests together, you need to use the ",[265,4075,4076],{},"batchRunReports"," method instead of the ",[265,4079,1089],{}," method. This works in a similar way as constructing multiple requests for the original API, which means that the requests are all included in an array within an outer object. Inside they have the same structure as if they were single requests.",[16,4082,4083],{},"As an example, we present a set of queries where the first query extracts the number of sessions within several days and the other on total sessions in the previous month. These queries can be used to compare the current sessions with the daily average in the last month. This example is selected for its simplicity; however, the concept can be used in a broad variety of cases, including comparison of data query to its filtered counterpart or comparison of multiple time periods that cannot be represented by a single dimension.",[296,4085,4087],{"className":298,"code":4086,"language":300,"meta":301,"style":301},"{\n    \"requests\": [\n        {\n            \"dateRanges\": [\n                {\n                    \"startDate\": \"2021-01-04\",\n                    \"endDate\": \"2021-01-06\"\n                }\n            ],\n            \"metrics\": [\n                {\n                    \"name\": \"sessions\"\n                }\n            ],\n            \"dimensions\": [\n                {\n                    \"name\": \"date\"\n                }\n            ],\n            \"orderBys\": [\n                {\n                    \"metric\": {\n                        \"metricName\": \"sessions\"\n                    },\n                    \"desc\": true\n                }\n            ]\n        },\n        {\n            \"dateRanges\": [\n                {\n                    \"startDate\": \"2020-12-01\",\n                    \"endDate\": \"2020-12-31\"\n                }\n            ],\n            \"metrics\": [\n                {\n                    \"name\": \"sessions\"\n                }\n            ]\n        }\n    ]\n }\n",[303,4088,4089,4093,4106,4110,4122,4126,4144,4160,4164,4168,4180,4184,4200,4204,4208,4220,4224,4240,4244,4248,4260,4264,4276,4292,4296,4308,4312,4316,4321,4325,4337,4341,4360,4377,4381,4385,4397,4401,4417,4421,4425,4429,4434],{"__ignoreMap":301},[306,4090,4091],{"class":308,"line":309},[306,4092,313],{"class":312},[306,4094,4095,4097,4100,4102,4104],{"class":308,"line":316},[306,4096,338],{"class":312},[306,4098,4099],{"class":322},"requests",[306,4101,326],{"class":312},[306,4103,329],{"class":312},[306,4105,1173],{"class":312},[306,4107,4108],{"class":308,"line":335},[306,4109,1801],{"class":312},[306,4111,4112,4114,4116,4118,4120],{"class":308,"line":361},[306,4113,2223],{"class":312},[306,4115,1166],{"class":341},[306,4117,326],{"class":312},[306,4119,329],{"class":312},[306,4121,1173],{"class":312},[306,4123,4124],{"class":308,"line":382},[306,4125,3057],{"class":312},[306,4127,4128,4130,4132,4134,4136,4138,4140,4142],{"class":308,"line":395},[306,4129,2238],{"class":312},[306,4131,1185],{"class":401},[306,4133,326],{"class":312},[306,4135,329],{"class":312},[306,4137,349],{"class":312},[306,4139,1194],{"class":352},[306,4141,326],{"class":312},[306,4143,358],{"class":312},[306,4145,4146,4148,4150,4152,4154,4156,4158],{"class":308,"line":414},[306,4147,2238],{"class":312},[306,4149,1205],{"class":401},[306,4151,326],{"class":312},[306,4153,329],{"class":312},[306,4155,349],{"class":312},[306,4157,1214],{"class":352},[306,4159,569],{"class":312},[306,4161,4162],{"class":308,"line":428},[306,4163,2274],{"class":312},[306,4165,4166],{"class":308,"line":465},[306,4167,3951],{"class":312},[306,4169,4170,4172,4174,4176,4178],{"class":308,"line":498},[306,4171,2223],{"class":312},[306,4173,1233],{"class":341},[306,4175,326],{"class":312},[306,4177,329],{"class":312},[306,4179,1173],{"class":312},[306,4181,4182],{"class":308,"line":504},[306,4183,3057],{"class":312},[306,4185,4186,4188,4190,4192,4194,4196,4198],{"class":308,"line":510},[306,4187,2238],{"class":312},[306,4189,1119],{"class":401},[306,4191,326],{"class":312},[306,4193,329],{"class":312},[306,4195,349],{"class":312},[306,4197,1258],{"class":352},[306,4199,569],{"class":312},[306,4201,4202],{"class":308,"line":531},[306,4203,2274],{"class":312},[306,4205,4206],{"class":308,"line":552},[306,4207,3951],{"class":312},[306,4209,4210,4212,4214,4216,4218],{"class":308,"line":572},[306,4211,2223],{"class":312},[306,4213,1275],{"class":341},[306,4215,326],{"class":312},[306,4217,329],{"class":312},[306,4219,1173],{"class":312},[306,4221,4222],{"class":308,"line":578},[306,4223,3057],{"class":312},[306,4225,4226,4228,4230,4232,4234,4236,4238],{"class":308,"line":592},[306,4227,2238],{"class":312},[306,4229,1119],{"class":401},[306,4231,326],{"class":312},[306,4233,329],{"class":312},[306,4235,349],{"class":312},[306,4237,1300],{"class":352},[306,4239,569],{"class":312},[306,4241,4242],{"class":308,"line":613},[306,4243,2274],{"class":312},[306,4245,4246],{"class":308,"line":634},[306,4247,3951],{"class":312},[306,4249,4250,4252,4254,4256,4258],{"class":308,"line":653},[306,4251,2223],{"class":312},[306,4253,1133],{"class":341},[306,4255,326],{"class":312},[306,4257,329],{"class":312},[306,4259,1173],{"class":312},[306,4261,4262],{"class":308,"line":658},[306,4263,3057],{"class":312},[306,4265,4266,4268,4270,4272,4274],{"class":308,"line":672},[306,4267,2238],{"class":312},[306,4269,1333],{"class":401},[306,4271,326],{"class":312},[306,4273,329],{"class":312},[306,4275,332],{"class":312},[306,4277,4278,4280,4282,4284,4286,4288,4290],{"class":308,"line":693},[306,4279,2350],{"class":312},[306,4281,1346],{"class":434},[306,4283,326],{"class":312},[306,4285,329],{"class":312},[306,4287,349],{"class":312},[306,4289,1258],{"class":352},[306,4291,569],{"class":312},[306,4293,4294],{"class":308,"line":714},[306,4295,3109],{"class":312},[306,4297,4298,4300,4302,4304,4306],{"class":308,"line":735},[306,4299,2238],{"class":312},[306,4301,1368],{"class":401},[306,4303,326],{"class":312},[306,4305,329],{"class":312},[306,4307,1375],{"class":312},[306,4309,4310],{"class":308,"line":751},[306,4311,2274],{"class":312},[306,4313,4314],{"class":308,"line":766},[306,4315,2279],{"class":312},[306,4317,4318],{"class":308,"line":771},[306,4319,4320],{"class":312},"        },\n",[306,4322,4323],{"class":308,"line":789},[306,4324,1801],{"class":312},[306,4326,4327,4329,4331,4333,4335],{"class":308,"line":1958},[306,4328,2223],{"class":312},[306,4330,1166],{"class":341},[306,4332,326],{"class":312},[306,4334,329],{"class":312},[306,4336,1173],{"class":312},[306,4338,4339],{"class":308,"line":1963},[306,4340,3057],{"class":312},[306,4342,4343,4345,4347,4349,4351,4353,4356,4358],{"class":308,"line":1968},[306,4344,2238],{"class":312},[306,4346,1185],{"class":401},[306,4348,326],{"class":312},[306,4350,329],{"class":312},[306,4352,349],{"class":312},[306,4354,4355],{"class":352},"2020-12-01",[306,4357,326],{"class":312},[306,4359,358],{"class":312},[306,4361,4362,4364,4366,4368,4370,4372,4375],{"class":308,"line":1973},[306,4363,2238],{"class":312},[306,4365,1205],{"class":401},[306,4367,326],{"class":312},[306,4369,329],{"class":312},[306,4371,349],{"class":312},[306,4373,4374],{"class":352},"2020-12-31",[306,4376,569],{"class":312},[306,4378,4379],{"class":308,"line":1978},[306,4380,2274],{"class":312},[306,4382,4383],{"class":308,"line":1991},[306,4384,3951],{"class":312},[306,4386,4387,4389,4391,4393,4395],{"class":308,"line":1996},[306,4388,2223],{"class":312},[306,4390,1233],{"class":341},[306,4392,326],{"class":312},[306,4394,329],{"class":312},[306,4396,1173],{"class":312},[306,4398,4399],{"class":308,"line":2014},[306,4400,3057],{"class":312},[306,4402,4403,4405,4407,4409,4411,4413,4415],{"class":308,"line":2019},[306,4404,2238],{"class":312},[306,4406,1119],{"class":401},[306,4408,326],{"class":312},[306,4410,329],{"class":312},[306,4412,349],{"class":312},[306,4414,1258],{"class":352},[306,4416,569],{"class":312},[306,4418,4419],{"class":308,"line":2024},[306,4420,2274],{"class":312},[306,4422,4423],{"class":308,"line":2037},[306,4424,2279],{"class":312},[306,4426,4427],{"class":308,"line":2042},[306,4428,1825],{"class":312},[306,4430,4431],{"class":308,"line":2060},[306,4432,4433],{"class":312},"    ]\n",[306,4435,4436],{"class":308,"line":2065},[306,4437,4438],{"class":312}," }\n",[11,4440,4442],{"id":4441},"pivot-queries","Pivot queries",[16,4444,4445,4446,4450,4451,4454,4455,4458],{},"Similar to cohorts’ analysis, the possibility to run pivot queries was already introduced with version 4 of the original API. More about the use of pivots in the original API can be found in our already mentioned ",[1049,4447,4449],{"href":1051,"rel":4448},[1053],"article on the original API version v4",". In GA4 API, pivots can be obtained using either ",[265,4452,4453],{},"runPivotReport"," (for a single request) or ",[265,4456,4457],{},"batchRunPivotReports"," (for multiple requests) methods.",[16,4460,4461],{},"Querying data as a pivot table is useful for dividing resulting values by further characteristics to view them from a different angle. For example, you can observe a number of errors per day using a simple query, but a pivot table allows you to extend the view by the browser they occurred in.",[16,4463,4464],{},"The structure is different from the structure in the original API, both for the queries and for the results, because the approach to pivot queries has changed. In the original API, you extend a simple query by a pivot table so that in the results, you can see both the simple query results and for each row of the results you can match the corresponding row of the pivot table. This is useful as it gives you aggregate results for each row of the pivot table. However, it also complicates the structure and the extraction of the data from the results.",[16,4466,4467,4468,4471,4472,4475,4476,4478,4479,4482,4483,4485,4486,4488],{},"In the GA4 API you can only extract the pivot table by itself (not in combination with the un-pivoted table as in the original API). The results that you receive are not in the structure of a pivot table, in fact, the results’ rows have the same content as if you did not query a pivot table. However, the key addition is the ",[303,4469,4470],{},"pivotHeader"," which allows the data to be transformed into the required pivot table. It uses the fact that data can be easily transformed between the classical and pivot formats, you just need to know the list of all values or combinations of values to construct the columns and then you can fill in the values. The shape of the pivot table is determined by the way you distribute the dimensions’ names into the ",[303,4473,4474],{},"pivots"," parameter array. The ",[303,4477,4470],{}," gives you the combination of values for those dimensions that you write together within ",[303,4480,4481],{},"fieldNames"," parameter of one item of the ",[303,4484,4474],{}," array and it gives you a list of values for single dimensions inside one item of the ",[303,4487,4474],{}," array. At the moment, it is up to you to construct the pivot table from these indicators.",[296,4490,4492],{"className":298,"code":4491,"language":300,"meta":301,"style":301},"{\n   \"dimensions\": [\n     {\n       \"name\": \"date\"\n     },\n     {\n       \"name\": \"deviceCategory\"\n     }\n   ],\n   \"metrics\": [\n     {\n       \"name\": \"sessions\"\n     }\n   ],\n   \"dateRanges\": [\n     {\n       \"startDate\": \"2021-01-04\",\n       \"endDate\": \"2021-01-06\"\n     }\n   ],\n   \"pivots\": [\n     {\n       \"fieldNames\": [\n         \"deviceCategory\"\n       ]\n     },\n    {\n       \"fieldNames\": [\n         \"date\"\n       ]\n     }\n   ]\n }\n",[303,4493,4494,4498,4511,4516,4533,4538,4542,4558,4563,4568,4580,4584,4600,4604,4608,4620,4624,4642,4658,4662,4666,4678,4682,4694,4703,4708,4712,4716,4728,4736,4740,4744,4749],{"__ignoreMap":301},[306,4495,4496],{"class":308,"line":309},[306,4497,313],{"class":312},[306,4499,4500,4503,4505,4507,4509],{"class":308,"line":316},[306,4501,4502],{"class":312},"   \"",[306,4504,1275],{"class":322},[306,4506,326],{"class":312},[306,4508,329],{"class":312},[306,4510,1173],{"class":312},[306,4512,4513],{"class":308,"line":335},[306,4514,4515],{"class":312},"     {\n",[306,4517,4518,4521,4523,4525,4527,4529,4531],{"class":308,"line":361},[306,4519,4520],{"class":312},"       \"",[306,4522,1119],{"class":341},[306,4524,326],{"class":312},[306,4526,329],{"class":312},[306,4528,349],{"class":312},[306,4530,1300],{"class":352},[306,4532,569],{"class":312},[306,4534,4535],{"class":308,"line":382},[306,4536,4537],{"class":312},"     },\n",[306,4539,4540],{"class":308,"line":395},[306,4541,4515],{"class":312},[306,4543,4544,4546,4548,4550,4552,4554,4556],{"class":308,"line":414},[306,4545,4520],{"class":312},[306,4547,1119],{"class":341},[306,4549,326],{"class":312},[306,4551,329],{"class":312},[306,4553,349],{"class":312},[306,4555,3124],{"class":352},[306,4557,569],{"class":312},[306,4559,4560],{"class":308,"line":428},[306,4561,4562],{"class":312},"     }\n",[306,4564,4565],{"class":308,"line":465},[306,4566,4567],{"class":312},"   ],\n",[306,4569,4570,4572,4574,4576,4578],{"class":308,"line":498},[306,4571,4502],{"class":312},[306,4573,1233],{"class":322},[306,4575,326],{"class":312},[306,4577,329],{"class":312},[306,4579,1173],{"class":312},[306,4581,4582],{"class":308,"line":504},[306,4583,4515],{"class":312},[306,4585,4586,4588,4590,4592,4594,4596,4598],{"class":308,"line":510},[306,4587,4520],{"class":312},[306,4589,1119],{"class":341},[306,4591,326],{"class":312},[306,4593,329],{"class":312},[306,4595,349],{"class":312},[306,4597,1258],{"class":352},[306,4599,569],{"class":312},[306,4601,4602],{"class":308,"line":531},[306,4603,4562],{"class":312},[306,4605,4606],{"class":308,"line":552},[306,4607,4567],{"class":312},[306,4609,4610,4612,4614,4616,4618],{"class":308,"line":572},[306,4611,4502],{"class":312},[306,4613,1166],{"class":322},[306,4615,326],{"class":312},[306,4617,329],{"class":312},[306,4619,1173],{"class":312},[306,4621,4622],{"class":308,"line":578},[306,4623,4515],{"class":312},[306,4625,4626,4628,4630,4632,4634,4636,4638,4640],{"class":308,"line":592},[306,4627,4520],{"class":312},[306,4629,1185],{"class":341},[306,4631,326],{"class":312},[306,4633,329],{"class":312},[306,4635,349],{"class":312},[306,4637,1194],{"class":352},[306,4639,326],{"class":312},[306,4641,358],{"class":312},[306,4643,4644,4646,4648,4650,4652,4654,4656],{"class":308,"line":613},[306,4645,4520],{"class":312},[306,4647,1205],{"class":341},[306,4649,326],{"class":312},[306,4651,329],{"class":312},[306,4653,349],{"class":312},[306,4655,1214],{"class":352},[306,4657,569],{"class":312},[306,4659,4660],{"class":308,"line":634},[306,4661,4562],{"class":312},[306,4663,4664],{"class":308,"line":653},[306,4665,4567],{"class":312},[306,4667,4668,4670,4672,4674,4676],{"class":308,"line":658},[306,4669,4502],{"class":312},[306,4671,4474],{"class":322},[306,4673,326],{"class":312},[306,4675,329],{"class":312},[306,4677,1173],{"class":312},[306,4679,4680],{"class":308,"line":672},[306,4681,4515],{"class":312},[306,4683,4684,4686,4688,4690,4692],{"class":308,"line":693},[306,4685,4520],{"class":312},[306,4687,4481],{"class":341},[306,4689,326],{"class":312},[306,4691,329],{"class":312},[306,4693,1173],{"class":312},[306,4695,4696,4699,4701],{"class":308,"line":714},[306,4697,4698],{"class":312},"         \"",[306,4700,3124],{"class":352},[306,4702,569],{"class":312},[306,4704,4705],{"class":308,"line":735},[306,4706,4707],{"class":312},"       ]\n",[306,4709,4710],{"class":308,"line":751},[306,4711,4537],{"class":312},[306,4713,4714],{"class":308,"line":766},[306,4715,1178],{"class":312},[306,4717,4718,4720,4722,4724,4726],{"class":308,"line":771},[306,4719,4520],{"class":312},[306,4721,4481],{"class":341},[306,4723,326],{"class":312},[306,4725,329],{"class":312},[306,4727,1173],{"class":312},[306,4729,4730,4732,4734],{"class":308,"line":789},[306,4731,4698],{"class":312},[306,4733,1300],{"class":352},[306,4735,569],{"class":312},[306,4737,4738],{"class":308,"line":1958},[306,4739,4707],{"class":312},[306,4741,4742],{"class":308,"line":1963},[306,4743,4562],{"class":312},[306,4745,4746],{"class":308,"line":1968},[306,4747,4748],{"class":312},"   ]\n",[306,4750,4751],{"class":308,"line":1973},[306,4752,4438],{"class":312},[4754,4755,4756],"figure",{},[4757,4758,4759,4776],"table",{},[4760,4761,4762],"thead",{},[4763,4764,4765,4768,4771,4773],"tr",{},[4766,4767,1300],"th",{},[4766,4769,4770],{},"desktop",[4766,4772,627],{},[4766,4774,4775],{},"tablet",[4777,4778,4779,4793,4807],"tbody",{},[4763,4780,4781,4784,4787,4790],{},[4782,4783,1194],"td",{},[4782,4785,4786],{},"1230",[4782,4788,4789],{},"990",[4782,4791,4792],{},"210",[4763,4794,4795,4798,4801,4804],{},[4782,4796,4797],{},"2021-01-05",[4782,4799,4800],{},"1410",[4782,4802,4803],{},"1280",[4782,4805,4806],{},"150",[4763,4808,4809,4811,4814,4817],{},[4782,4810,1214],{},[4782,4812,4813],{},"1370",[4782,4815,4816],{},"1290",[4782,4818,4819],{},"180",[16,4821,4822],{},[3489,4823],{"alt":301,"src":4824,"title":4825},"\u002Fupload\u002Fdata-results.webp","Data Results",[11,4827,4829],{"id":4828},"python-example","Python example",[16,4831,4832],{},"Until now we have talked about the JSON-structured queries used in the request body of cURL, HTTP, or JavaScript requests. However, it is possible to run the requests in Python as well, using Google Python library called google-analytics-data. The run of the Python code requires receiving a path to an access token for the service account and GA4 property ID to which this service account has access.",[16,4834,4835,4836,4839,4840,4843],{},"We include a sample code along with information on how to prepare your environment. To run the Python code, you need to first set up a virtual environment, then prepare a file with a path to an access token for the service account, and then you can run the Python code which will ask you to input the ",[303,4837,4838],{},"property_id"," as an argument. For the setup on Windows, run the code below in Command Prompt. Replace the place holder ",[303,4841,4842],{},"\u003Cyour-env>"," with the selected name for your environment.",[296,4845,4849],{"className":4846,"code":4847,"language":4848,"meta":301,"style":301},"language-powershell shiki shiki-themes material-theme-ocean","pip install virtualenv\n  virtualenv \u003Cyour-env>\n  \u003Cyour-env>\\Scripts\\activate\n  \u003Cyour-env>\\Scripts\\pip.exe install google-analytics-data pandas python-dotenv\n","powershell",[303,4850,4851,4856,4861,4866],{"__ignoreMap":301},[306,4852,4853],{"class":308,"line":309},[306,4854,4855],{},"pip install virtualenv\n",[306,4857,4858],{"class":308,"line":316},[306,4859,4860],{},"  virtualenv \u003Cyour-env>\n",[306,4862,4863],{"class":308,"line":335},[306,4864,4865],{},"  \u003Cyour-env>\\Scripts\\activate\n",[306,4867,4868],{"class":308,"line":361},[306,4869,4870],{},"  \u003Cyour-env>\\Scripts\\pip.exe install google-analytics-data pandas python-dotenv\n",[16,4872,4873,4874,4877],{},"To prepare the access to data, you need to have a service account that has access to the GA4 property data. The local path needs to be saved under the parameter ",[303,4875,4876],{},"SERVICE_TOKEN_PATH"," in .env file which is located in the same folder as the Python code. The format of the file should be as follows:",[296,4879,4881],{"className":4846,"code":4880,"language":4848,"meta":301,"style":301},"SERVICE_TOKEN_PATH=\"C:\u002FUsers\u002FYourUser\u002FDocuments\u002Fservice_account_token.json\"\n",[303,4882,4883],{"__ignoreMap":301},[306,4884,4885],{"class":308,"line":309},[306,4886,4880],{},[16,4888,4889,4890,4895],{},"If you need any help creating the service token, refer to ",[1049,4891,4894],{"href":4892,"rel":4893},"https:\u002F\u002Fcloud.google.com\u002Fiam\u002Fdocs\u002Fcreating-managing-service-accounts.",[1053],"official documents",".",[16,4897,4898,4899,4895],{},"When you have set up the virtual environment, prepare the .env file and set the GA4 property ID into the parameter property_id, you can run the Python code to obtain the sample results. The code loads and prints data about active users and a number of sessions by the date, country, and city characteristics, since the beginning of the year 2021. For more information about the library, you can ",[1049,4900,4903],{"href":4901,"rel":4902},"https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-analytics-data",[1053],"check the client library source code",[296,4905,4909],{"className":4906,"code":4907,"language":4908,"meta":301,"style":301},"language-py shiki shiki-themes material-theme-ocean","    from dotenv import load_dotenv\n    import os\n    import json\n    import pandas as pd\n    from google.analytics.data_v1beta import BetaAnalyticsDataClient\n    from google.analytics.data_v1beta.types import DateRange, Dimension, Metric, RunReportRequest\n    \n    # Setting \n    #(.env file is located in the same location and contains SERVICE_TOKEN_PATH=[local-path-to-Google-service-token-with-data-access])\n    load_dotenv()\n    SERVICE_TOKEN_PATH = os.getenv('SERVICE_TOKEN_PATH')\n    property_id = '\u003Cset-your-property-ID-here>'\n    \n    def sample_run_report(property_id):\n        \"\"\"Runs a simple report on a Google Analytics 4 property.\"\"\"\n    \n        client = AlphaAnalyticsDataClient.from_service_account_file(SERVICE_TOKEN_PATH)\n        request = RunReportRequest(property=f\"properties\u002F{​property_id}​\",\n                                   dimensions=[Dimension(name='date'), Dimension(name='country'), Dimension(name='city')],\n                                   metrics=[Metric(name='activeUsers'), Metric(name='sessions')],\n                                   date_ranges=[DateRange(start_date='2021-01-01', end_date='yesterday')])\n        response = client.run_report(request)\n        return response\n    \n    def sample_extract_data(response):\n        \"\"\"Extracts data from GA 4 Data API response as Pandas Dataframe \"\"\"\n        data_dict = {}\n        for row in response.rows:\n                data_dict_row = []\n                for i in range(len(row.dimension_values)):\n                    data_dict_row.append(row.dimension_values[i].value)\n                for j in range(len(row.metric_values)):\n                    data_dict_row.append(row.metric_values[j].value)\n                data_dict[response.rows.index(row)] = data_dict_row\n    \n        columns_list = []\n        for dim_header in response.dimension_headers:\n            columns_list.append(dim_header.name)\n        for met_header in response.metric_headers:\n            columns_list.append(met_header.name)\n        return pd.DataFrame.from_dict(data_dict, orient='index', columns = columns_list)\n    \n    \n    if __name__ == \"__main__\":\n        query_response = sample_run_report(property_id)\n        sample_extract_data(query_response)\n","py",[303,4910,4911,4916,4921,4926,4931,4936,4941,4946,4951,4956,4961,4966,4971,4975,4980,4985,4989,4994,4999,5004,5009,5014,5019,5024,5028,5033,5038,5043,5048,5053,5058,5063,5068,5073,5078,5082,5087,5092,5097,5102,5107,5112,5116,5120,5125,5130],{"__ignoreMap":301},[306,4912,4913],{"class":308,"line":309},[306,4914,4915],{},"    from dotenv import load_dotenv\n",[306,4917,4918],{"class":308,"line":316},[306,4919,4920],{},"    import os\n",[306,4922,4923],{"class":308,"line":335},[306,4924,4925],{},"    import json\n",[306,4927,4928],{"class":308,"line":361},[306,4929,4930],{},"    import pandas as pd\n",[306,4932,4933],{"class":308,"line":382},[306,4934,4935],{},"    from google.analytics.data_v1beta import BetaAnalyticsDataClient\n",[306,4937,4938],{"class":308,"line":395},[306,4939,4940],{},"    from google.analytics.data_v1beta.types import DateRange, Dimension, Metric, RunReportRequest\n",[306,4942,4943],{"class":308,"line":414},[306,4944,4945],{},"    \n",[306,4947,4948],{"class":308,"line":428},[306,4949,4950],{},"    # Setting \n",[306,4952,4953],{"class":308,"line":465},[306,4954,4955],{},"    #(.env file is located in the same location and contains SERVICE_TOKEN_PATH=[local-path-to-Google-service-token-with-data-access])\n",[306,4957,4958],{"class":308,"line":498},[306,4959,4960],{},"    load_dotenv()\n",[306,4962,4963],{"class":308,"line":504},[306,4964,4965],{},"    SERVICE_TOKEN_PATH = os.getenv('SERVICE_TOKEN_PATH')\n",[306,4967,4968],{"class":308,"line":510},[306,4969,4970],{},"    property_id = '\u003Cset-your-property-ID-here>'\n",[306,4972,4973],{"class":308,"line":531},[306,4974,4945],{},[306,4976,4977],{"class":308,"line":552},[306,4978,4979],{},"    def sample_run_report(property_id):\n",[306,4981,4982],{"class":308,"line":572},[306,4983,4984],{},"        \"\"\"Runs a simple report on a Google Analytics 4 property.\"\"\"\n",[306,4986,4987],{"class":308,"line":578},[306,4988,4945],{},[306,4990,4991],{"class":308,"line":592},[306,4992,4993],{},"        client = AlphaAnalyticsDataClient.from_service_account_file(SERVICE_TOKEN_PATH)\n",[306,4995,4996],{"class":308,"line":613},[306,4997,4998],{},"        request = RunReportRequest(property=f\"properties\u002F{​property_id}​\",\n",[306,5000,5001],{"class":308,"line":634},[306,5002,5003],{},"                                   dimensions=[Dimension(name='date'), Dimension(name='country'), Dimension(name='city')],\n",[306,5005,5006],{"class":308,"line":653},[306,5007,5008],{},"                                   metrics=[Metric(name='activeUsers'), Metric(name='sessions')],\n",[306,5010,5011],{"class":308,"line":658},[306,5012,5013],{},"                                   date_ranges=[DateRange(start_date='2021-01-01', end_date='yesterday')])\n",[306,5015,5016],{"class":308,"line":672},[306,5017,5018],{},"        response = client.run_report(request)\n",[306,5020,5021],{"class":308,"line":693},[306,5022,5023],{},"        return response\n",[306,5025,5026],{"class":308,"line":714},[306,5027,4945],{},[306,5029,5030],{"class":308,"line":735},[306,5031,5032],{},"    def sample_extract_data(response):\n",[306,5034,5035],{"class":308,"line":751},[306,5036,5037],{},"        \"\"\"Extracts data from GA 4 Data API response as Pandas Dataframe \"\"\"\n",[306,5039,5040],{"class":308,"line":766},[306,5041,5042],{},"        data_dict = {}\n",[306,5044,5045],{"class":308,"line":771},[306,5046,5047],{},"        for row in response.rows:\n",[306,5049,5050],{"class":308,"line":789},[306,5051,5052],{},"                data_dict_row = []\n",[306,5054,5055],{"class":308,"line":1958},[306,5056,5057],{},"                for i in range(len(row.dimension_values)):\n",[306,5059,5060],{"class":308,"line":1963},[306,5061,5062],{},"                    data_dict_row.append(row.dimension_values[i].value)\n",[306,5064,5065],{"class":308,"line":1968},[306,5066,5067],{},"                for j in range(len(row.metric_values)):\n",[306,5069,5070],{"class":308,"line":1973},[306,5071,5072],{},"                    data_dict_row.append(row.metric_values[j].value)\n",[306,5074,5075],{"class":308,"line":1978},[306,5076,5077],{},"                data_dict[response.rows.index(row)] = data_dict_row\n",[306,5079,5080],{"class":308,"line":1991},[306,5081,4945],{},[306,5083,5084],{"class":308,"line":1996},[306,5085,5086],{},"        columns_list = []\n",[306,5088,5089],{"class":308,"line":2014},[306,5090,5091],{},"        for dim_header in response.dimension_headers:\n",[306,5093,5094],{"class":308,"line":2019},[306,5095,5096],{},"            columns_list.append(dim_header.name)\n",[306,5098,5099],{"class":308,"line":2024},[306,5100,5101],{},"        for met_header in response.metric_headers:\n",[306,5103,5104],{"class":308,"line":2037},[306,5105,5106],{},"            columns_list.append(met_header.name)\n",[306,5108,5109],{"class":308,"line":2042},[306,5110,5111],{},"        return pd.DataFrame.from_dict(data_dict, orient='index', columns = columns_list)\n",[306,5113,5114],{"class":308,"line":2060},[306,5115,4945],{},[306,5117,5118],{"class":308,"line":2065},[306,5119,4945],{},[306,5121,5122],{"class":308,"line":2070},[306,5123,5124],{},"    if __name__ == \"__main__\":\n",[306,5126,5127],{"class":308,"line":2075},[306,5128,5129],{},"        query_response = sample_run_report(property_id)\n",[306,5131,5132],{"class":308,"line":2080},[306,5133,5134],{},"        sample_extract_data(query_response)\n",[11,5136,5138],{"id":5137},"summary","Summary",[16,5140,5141],{},"The newly published Google Analytics Data API is constructed to query data from Google Analytics 4. In this article, we summarized its similarities and differences to the GA Reporting API v4 for Universal Analytics. The basic parameters and results’ structure are very similar between these approaches but there are some new features introduced (like Quotas report) and there are several steps towards consistency between dimensions and metrics and between different types of queries. Thus, the GA Data API does not seem to be very difficult to transition to and at the same time, it brings the unique experience of working with the new Google Analytics.",[1045,5143,5144,5145,5149,5150,5149,5154,5149,5158,5162,5163,5167],{},"\nMore information about the methods is provided in official Google’s documentation on the GA4 API (\n",[1049,5146,1089],{"href":5147,"rel":5148},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Frest\u002Fv1beta\u002Fproperties\u002FrunReport",[1053],"\n, \n",[1049,5151,4453],{"href":5152,"rel":5153},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Frest\u002Fv1beta\u002Fproperties\u002FrunPivotReport",[1053],[1049,5155,4076],{"href":5156,"rel":5157},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Frest\u002Fv1beta\u002Fproperties\u002FbatchRunReports",[1053],[1049,5159,4457],{"href":5160,"rel":5161},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Frest\u002Fv1beta\u002Fproperties\u002FbatchRunPivotReports",[1053],"\n) where you can also run the queries in the API Explorer. For easier use, Google provides a comprehensive \n",[1049,5164,353],{"href":5165,"rel":5166},"https:\u002F\u002Fdevelopers.google.com\u002Fanalytics\u002Fdevguides\u002Freporting\u002Fdata\u002Fv1\u002Fapi-schema",[1053],"\n of all currently available dimensions and metrics.\n",[969,5169,5171],{"link":971,"button":5170},"Contact Us","\n Our methodology has successfully revealed and corrected the data issue and supported the accuracy of the evaluation for multiple clients. Contact us for more information. We can ensure the accuracy of your A\u002FB testing too. \n",[975,5173,5174],{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAklC, html code.shiki .sAklC{--shiki-default:#89DDFF}html pre.shiki code .sJ14y, html code.shiki .sJ14y{--shiki-default:#C792EA}html pre.shiki code .s5Dmg, html code.shiki .s5Dmg{--shiki-default:#FFCB6B}html pre.shiki code .sfyAc, html code.shiki .sfyAc{--shiki-default:#C3E88D}html pre.shiki code .sx098, html code.shiki .sx098{--shiki-default:#F78C6C}html pre.shiki code .s-wAU, html code.shiki .s-wAU{--shiki-default:#F07178}html pre.shiki code .s0W1g, html code.shiki .s0W1g{--shiki-default:#BABED8}html pre.shiki code .s9WhI, html code.shiki .s9WhI{--shiki-default:#916B53}html pre.shiki code .sdLwU, html code.shiki .sdLwU{--shiki-default:#82AAFF}html pre.shiki code .sbqyR, html code.shiki .sbqyR{--shiki-default:#FF9CAC}",{"title":301,"searchDepth":316,"depth":316,"links":5176},[5177,5181,5187,5188,5189,5190],{"id":1082,"depth":316,"text":1083,"children":5178},[5179,5180],{"id":1098,"depth":335,"text":1101},{"id":1647,"depth":335,"text":1648},{"id":2674,"depth":316,"text":2675,"children":5182},[5183,5184,5185,5186],{"id":2678,"depth":335,"text":2679},{"id":2917,"depth":335,"text":2918},{"id":3463,"depth":335,"text":3464},{"id":4038,"depth":335,"text":4039},{"id":4069,"depth":316,"text":4070},{"id":4441,"depth":316,"text":4442},{"id":4828,"depth":316,"text":4829},{"id":5137,"depth":316,"text":5138},"The new version of Google Analytics with an innovative approach to data structure has been introduced in summer 2019, under the name Google Analytics App + Web. In autumn 2020 Google released it from the beta version and rebranded it as Google Analytics 4. While it is still not recommended to transfer your whole data measurement to the new version as it is being gradually improved, it definitely deserves increased attention as Google is introducing many new features there. The new Google Analytics 4 is based on events and their parameters. As its previous name implies, it combines data from apps and web analytics in one property. Moreover, it serves as a flexible tool for cross-platform analysis. To learn more about Google Analytics 4, follow our blog for an upcoming article in which we will discuss changes and new features of the GA4, extensively.","\u002Fupload\u002Fga4-api-banner.webp",false,{},"Do you need to migrate from Universal Analytics Reporting API to the new GA4 reporting API v1? A practical guide how to migrate to the new version.","\u002Fen\u002Fblog\u002Fnew-data-api-for-google-analytics-4","2021-03-30T02:12:10.000+00:00",19.75,"20 min read",[1017,5201],"content\u002Fen\u002Fblog\u002Fdata-layer-validation-what-why-and-how.md",{"title":1026,"description":5191},"en\u002Fblog\u002Fnew-data-api-for-google-analytics-4","Have you tried the new Google Analytics 4 (formerly App + Web) and want to learn more about its Data API? Are you wondering how to query the data measured using the new Google Analytics 4? We tested the Data API features for you and compared them to the currently used API for Universal Analytics.","2021-06-14T01:41:00.000+00:00","jQHyTtsGpkuGi2WT-38RuI0B19oxm1PhCoplxWK5deU",{"id":5208,"title":5209,"author":6,"body":5210,"category":6,"description":301,"extension":1008,"image":7222,"isToc":5193,"langAlt":6,"meta":7223,"metaDescription":7224,"navigation":1010,"path":7225,"published":1010,"publishedAt":7226,"readingTimeMinutes":7227,"readingTimeText":7228,"relatedArticles":6,"seo":7229,"stem":7230,"teaser":7224,"updatedAtCustom":6,"__hash__":7231},"blog_en\u002Fen\u002Fblog\u002Fnotes-on-new-features-of-google-analytics-reporting-api-v4.md","Notes on new features of Google Analytics Reporting API v4",{"type":8,"value":5211,"toc":7212},[5212,5219,5221,5227,5230,5233,5246,5250,5253,5274,5277,5281,5288,5349,5566,5570,5581,5584,5594,5597,5600,5605,5967,5971,5981,5984,5987,6206,6530,6534,6552,6626,7169,7173,7180,7187,7191,7194,7206,7209],[1067,5213,5214,5215,1055],{},"\nThis is the latest version of the legacy Google Analytics API. For GA4 API v1 read \n",[1049,5216,5218],{"href":5217},"\u002Fen\u002Fblog\u002Fnew-data-api-for-google-analytics-4\u002F","this",[2957,5220],{},[16,5222,5223,5224,4895],{},"The current version of the Google Analytics Reporting API was introduced some time ago offering several new features in comparison to the previous version. While the API v3 is still going to be supported, it might be beneficial to consider using the newer API v4 as it presents several interesting cases. With the API v4, you can use the same structure of queries as before, however, you can benefit from the new features, which will help you ",[265,5225,5226],{},"access your data more efficiently",[16,5228,5229],{},"This summary describes the improvements in more detail – what is new in the v4 API and why it is beneficial. There are 4 main cases plus a few additional possibilities included in the current version of the Reporting API.",[16,5231,5232],{},"Special features we find the most beneficial:",[45,5234,5235,5238,5241,5243],{},[48,5236,5237],{},"Metric expression",[48,5239,5240],{},"Histograms",[48,5242,3464],{},[48,5244,5245],{},"Pivot",[11,5247,5249],{"id":5248},"why-use-google-analytics-reporting-api-in-general","Why use Google Analytics Reporting API in general",[16,5251,5252],{},"The Google Analytics Reporting API is widely used as it is a part of the standard version of Google Analytics. It allows you to",[45,5254,5255,5258,5261,5264,5267],{},[48,5256,5257],{},"Quickly obtain data for further processing and analysis",[48,5259,5260],{},"Reach data by querying from code (using authentication) or some advanced solution (e.g. Roivenue)",[48,5262,5263],{},"Explore data using many ready-made integrations (including the Query Explorer)",[48,5265,5266],{},"Save time by automating loading data and other reporting tasks",[48,5268,5269,5270,5273],{},"Use data in advanced data analytical programs (e.g. ",[1049,5271,1074],{"href":1072,"rel":5272},[1053],")",[16,5275,5276],{},"In short, the Google Analytics Reporting APIs are very useful, so let’s have a look at the current version.",[61,5278,5280],{"id":5279},"extended-metric-expression","Extended metric expression",[16,5282,5283,5284,5287],{},"To simplify data manipulation, it is now possible to input expressions of metrics instead of single metrics’ names only. In particular, to compare the Pages per Session ratio across multiple groups of customers or multiple days, it is sufficient to ",[265,5285,5286],{},"write the formula"," for the ratio within the metric expression field and the resulting data directly lets you compare the evolution of the ratio without the need to transform the data further. The expression allows basic operations. While there is a limit on the number of characters within the expression, the most used formulas should fit within. You can choose your name for the output of the expression which further increases the legibility of the output data. This helps to create easily understandable tables with a single query.",[4754,5289,5290],{},[4757,5291,5292,5302],{},[4760,5293,5294],{},[4763,5295,5296,5299],{},[4766,5297,5298],{},"Month of the year",[4766,5300,5301],{},"Pages per Session ratio",[4777,5303,5304,5312,5319,5327,5334,5342],{},[4763,5305,5306,5309],{},[4782,5307,5308],{},"01",[4782,5310,5311],{},"5",[4763,5313,5314,5317],{},[4782,5315,5316],{},"02",[4782,5318,5311],{},[4763,5320,5321,5324],{},[4782,5322,5323],{},"03",[4782,5325,5326],{},"6",[4763,5328,5329,5332],{},[4782,5330,5331],{},"04",[4782,5333,5311],{},[4763,5335,5336,5339],{},[4782,5337,5338],{},"05",[4782,5340,5341],{},"4",[4763,5343,5344,5347],{},[4782,5345,5346],{},"06",[4782,5348,5341],{},[296,5350,5352],{"className":298,"code":5351,"language":300,"meta":301,"style":301},"{\n  \"reportRequests\": [\n    {\n      \"viewId\": \"XXXXXXXXX\",\n      \"dateRanges\": [\n        {\n          \"startDate\": \"2020-01-01\",\n          \"endDate\": \"yesterday\"\n        }\n      ],\n      \"metrics\": [\n        {\n          \"expression\": \"ga:pageViews\u002Fga:sessions\",\n          \"alias\": \"page views sessions ratio\"\n        }\n      ],\n      \"dimensions\": [\n        {\n          \"name\": \"ga:month\"\n        }\n      ]\n    }\n  ]\n}\n",[303,5353,5354,5358,5371,5375,5393,5405,5409,5428,5445,5449,5453,5465,5469,5488,5505,5509,5513,5525,5529,5546,5550,5554,5558,5562],{"__ignoreMap":301},[306,5355,5356],{"class":308,"line":309},[306,5357,313],{"class":312},[306,5359,5360,5362,5365,5367,5369],{"class":308,"line":316},[306,5361,319],{"class":312},[306,5363,5364],{"class":322},"reportRequests",[306,5366,326],{"class":312},[306,5368,329],{"class":312},[306,5370,1173],{"class":312},[306,5372,5373],{"class":308,"line":335},[306,5374,1178],{"class":312},[306,5376,5377,5379,5381,5383,5385,5387,5389,5391],{"class":308,"line":361},[306,5378,398],{"class":312},[306,5380,1409],{"class":341},[306,5382,326],{"class":312},[306,5384,329],{"class":312},[306,5386,349],{"class":312},[306,5388,1418],{"class":352},[306,5390,326],{"class":312},[306,5392,358],{"class":312},[306,5394,5395,5397,5399,5401,5403],{"class":308,"line":382},[306,5396,398],{"class":312},[306,5398,1166],{"class":341},[306,5400,326],{"class":312},[306,5402,329],{"class":312},[306,5404,1173],{"class":312},[306,5406,5407],{"class":308,"line":395},[306,5408,1801],{"class":312},[306,5410,5411,5413,5415,5417,5419,5421,5424,5426],{"class":308,"line":414},[306,5412,1806],{"class":312},[306,5414,1185],{"class":401},[306,5416,326],{"class":312},[306,5418,329],{"class":312},[306,5420,349],{"class":312},[306,5422,5423],{"class":352},"2020-01-01",[306,5425,326],{"class":312},[306,5427,358],{"class":312},[306,5429,5430,5432,5434,5436,5438,5440,5443],{"class":308,"line":428},[306,5431,1806],{"class":312},[306,5433,1205],{"class":401},[306,5435,326],{"class":312},[306,5437,329],{"class":312},[306,5439,349],{"class":312},[306,5441,5442],{"class":352},"yesterday",[306,5444,569],{"class":312},[306,5446,5447],{"class":308,"line":465},[306,5448,1825],{"class":312},[306,5450,5451],{"class":308,"line":498},[306,5452,1830],{"class":312},[306,5454,5455,5457,5459,5461,5463],{"class":308,"line":504},[306,5456,398],{"class":312},[306,5458,1233],{"class":341},[306,5460,326],{"class":312},[306,5462,329],{"class":312},[306,5464,1173],{"class":312},[306,5466,5467],{"class":308,"line":510},[306,5468,1801],{"class":312},[306,5470,5471,5473,5475,5477,5479,5481,5484,5486],{"class":308,"line":531},[306,5472,1806],{"class":312},[306,5474,1123],{"class":401},[306,5476,326],{"class":312},[306,5478,329],{"class":312},[306,5480,349],{"class":312},[306,5482,5483],{"class":352},"ga:pageViews\u002Fga:sessions",[306,5485,326],{"class":312},[306,5487,358],{"class":312},[306,5489,5490,5492,5494,5496,5498,5500,5503],{"class":308,"line":552},[306,5491,1806],{"class":312},[306,5493,1522],{"class":401},[306,5495,326],{"class":312},[306,5497,329],{"class":312},[306,5499,349],{"class":312},[306,5501,5502],{"class":352},"page views sessions ratio",[306,5504,569],{"class":312},[306,5506,5507],{"class":308,"line":572},[306,5508,1825],{"class":312},[306,5510,5511],{"class":308,"line":578},[306,5512,1830],{"class":312},[306,5514,5515,5517,5519,5521,5523],{"class":308,"line":592},[306,5516,398],{"class":312},[306,5518,1275],{"class":341},[306,5520,326],{"class":312},[306,5522,329],{"class":312},[306,5524,1173],{"class":312},[306,5526,5527],{"class":308,"line":613},[306,5528,1801],{"class":312},[306,5530,5531,5533,5535,5537,5539,5541,5544],{"class":308,"line":634},[306,5532,1806],{"class":312},[306,5534,1119],{"class":401},[306,5536,326],{"class":312},[306,5538,329],{"class":312},[306,5540,349],{"class":312},[306,5542,5543],{"class":352},"ga:month",[306,5545,569],{"class":312},[306,5547,5548],{"class":308,"line":653},[306,5549,1825],{"class":312},[306,5551,5552],{"class":308,"line":658},[306,5553,1873],{"class":312},[306,5555,5556],{"class":308,"line":672},[306,5557,1221],{"class":312},[306,5559,5560],{"class":308,"line":693},[306,5561,1384],{"class":312},[306,5563,5564],{"class":308,"line":714},[306,5565,792],{"class":312},[61,5567,5569],{"id":5568},"histogram","Histogram",[16,5571,5572,5573,5576,5577,5580],{},"Another feature extends the use of dimensions as it allows a numeric dimension to be converted into groups, so-called buckets, by specified breaks. The breaks work as thresholds separating the values into the buckets. There are always ",[1062,5574,5575],{},"n+1"," buckets for ",[1062,5578,5579],{},"n"," thresholds - for two break points there will be three buckets with the following structure of names “\u003C[break1]”, “[break1]”, “[break2]+”.",[16,5582,5583],{},"The easiest application of this feature lies in the aggregation of time variables, even though you’ll find further uses based on your specific case. The histogram allows you to construct quarters from months, combine several, even irregular amounts of days or weeks together, or compare several phases within a day. The last case is shown in the following example.",[16,5585,5586,5587,1141,5590,5593],{},"The histogram request results in an ",[265,5588,5589],{},"aggregated",[265,5591,5592],{},"table of all selected metrics grouped by the created groups"," (buckets). The output does not change the structure of the data, so you can use the data in further programs and applications without the need to form any additional schema or adjust any data manipulations. You can select multiple metrics to compare the evolution of several values in parallel, as in the following example.",[16,5595,5596],{},"The output from this request can be transformed into a histogram using the buckets to form the columns with the values of metrics as their height. This provides an easy view of the evolution of your data.",[1045,5598,5599],{},"\nWhen you want to form a graph using several metrics, you need to be careful if the metrics have diametrically different values, as the graph can be not as informative for the smaller metric.\n",[16,5601,5602],{},[3489,5603],{"alt":301,"src":5604},"\u002Fupload\u002Fga-api-v4-article-users-and-sessions-chart-1.png",[296,5606,5608],{"className":298,"code":5607,"language":300,"meta":301,"style":301},"{\n  \"reportRequests\": [\n    {\n      \"viewId\": \"XXXXXXXXX\",\n      \"dateRanges\": [\n        {\n          \"startDate\": \"2020-01-01\",\n          \"endDate\": \"yesterday\"\n        }\n      ],\n      \"metrics\": [\n        {\n          \"expression\": \"ga:users\"\n        },\n        {\n          \"expression\": \"ga:sessions\"\n        }\n      ],\n      \"dimensions\": [\n        {\n          \"name\": \"ga:month\",\n          \"histogramBuckets\": [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]\n        }\n      ],\n      \"orderBys\": [\n        {\n          \"fieldName\": \"ga:month\",\n          \"orderType\": \"HISTOGRAM_BUCKET\",\n          \"sortOrder\": \"ASCENDING\"\n        }\n      ]\n    }\n  ]\n}\n",[303,5609,5610,5614,5626,5630,5648,5660,5664,5682,5698,5702,5706,5718,5722,5738,5742,5746,5762,5766,5770,5782,5786,5804,5868,5872,5876,5888,5892,5910,5930,5947,5951,5955,5959,5963],{"__ignoreMap":301},[306,5611,5612],{"class":308,"line":309},[306,5613,313],{"class":312},[306,5615,5616,5618,5620,5622,5624],{"class":308,"line":316},[306,5617,319],{"class":312},[306,5619,5364],{"class":322},[306,5621,326],{"class":312},[306,5623,329],{"class":312},[306,5625,1173],{"class":312},[306,5627,5628],{"class":308,"line":335},[306,5629,1178],{"class":312},[306,5631,5632,5634,5636,5638,5640,5642,5644,5646],{"class":308,"line":361},[306,5633,398],{"class":312},[306,5635,1409],{"class":341},[306,5637,326],{"class":312},[306,5639,329],{"class":312},[306,5641,349],{"class":312},[306,5643,1418],{"class":352},[306,5645,326],{"class":312},[306,5647,358],{"class":312},[306,5649,5650,5652,5654,5656,5658],{"class":308,"line":382},[306,5651,398],{"class":312},[306,5653,1166],{"class":341},[306,5655,326],{"class":312},[306,5657,329],{"class":312},[306,5659,1173],{"class":312},[306,5661,5662],{"class":308,"line":395},[306,5663,1801],{"class":312},[306,5665,5666,5668,5670,5672,5674,5676,5678,5680],{"class":308,"line":414},[306,5667,1806],{"class":312},[306,5669,1185],{"class":401},[306,5671,326],{"class":312},[306,5673,329],{"class":312},[306,5675,349],{"class":312},[306,5677,5423],{"class":352},[306,5679,326],{"class":312},[306,5681,358],{"class":312},[306,5683,5684,5686,5688,5690,5692,5694,5696],{"class":308,"line":428},[306,5685,1806],{"class":312},[306,5687,1205],{"class":401},[306,5689,326],{"class":312},[306,5691,329],{"class":312},[306,5693,349],{"class":312},[306,5695,5442],{"class":352},[306,5697,569],{"class":312},[306,5699,5700],{"class":308,"line":465},[306,5701,1825],{"class":312},[306,5703,5704],{"class":308,"line":498},[306,5705,1830],{"class":312},[306,5707,5708,5710,5712,5714,5716],{"class":308,"line":504},[306,5709,398],{"class":312},[306,5711,1233],{"class":341},[306,5713,326],{"class":312},[306,5715,329],{"class":312},[306,5717,1173],{"class":312},[306,5719,5720],{"class":308,"line":510},[306,5721,1801],{"class":312},[306,5723,5724,5726,5728,5730,5732,5734,5736],{"class":308,"line":531},[306,5725,1806],{"class":312},[306,5727,1123],{"class":401},[306,5729,326],{"class":312},[306,5731,329],{"class":312},[306,5733,349],{"class":312},[306,5735,1630],{"class":352},[306,5737,569],{"class":312},[306,5739,5740],{"class":308,"line":552},[306,5741,4320],{"class":312},[306,5743,5744],{"class":308,"line":572},[306,5745,1801],{"class":312},[306,5747,5748,5750,5752,5754,5756,5758,5760],{"class":308,"line":578},[306,5749,1806],{"class":312},[306,5751,1123],{"class":401},[306,5753,326],{"class":312},[306,5755,329],{"class":312},[306,5757,349],{"class":312},[306,5759,1511],{"class":352},[306,5761,569],{"class":312},[306,5763,5764],{"class":308,"line":592},[306,5765,1825],{"class":312},[306,5767,5768],{"class":308,"line":613},[306,5769,1830],{"class":312},[306,5771,5772,5774,5776,5778,5780],{"class":308,"line":634},[306,5773,398],{"class":312},[306,5775,1275],{"class":341},[306,5777,326],{"class":312},[306,5779,329],{"class":312},[306,5781,1173],{"class":312},[306,5783,5784],{"class":308,"line":653},[306,5785,1801],{"class":312},[306,5787,5788,5790,5792,5794,5796,5798,5800,5802],{"class":308,"line":658},[306,5789,1806],{"class":312},[306,5791,1119],{"class":401},[306,5793,326],{"class":312},[306,5795,329],{"class":312},[306,5797,349],{"class":312},[306,5799,5543],{"class":352},[306,5801,326],{"class":312},[306,5803,358],{"class":312},[306,5805,5806,5808,5811,5813,5815,5817,5819,5822,5824,5826,5828,5831,5833,5835,5837,5840,5842,5844,5846,5848,5850,5852,5854,5856,5858,5860,5862,5864,5866],{"class":308,"line":672},[306,5807,1806],{"class":312},[306,5809,5810],{"class":401},"histogramBuckets",[306,5812,326],{"class":312},[306,5814,329],{"class":312},[306,5816,442],{"class":312},[306,5818,326],{"class":312},[306,5820,5821],{"class":352},"1",[306,5823,326],{"class":312},[306,5825,452],{"class":312},[306,5827,349],{"class":312},[306,5829,5830],{"class":352},"2",[306,5832,326],{"class":312},[306,5834,452],{"class":312},[306,5836,349],{"class":312},[306,5838,5839],{"class":352},"3",[306,5841,326],{"class":312},[306,5843,452],{"class":312},[306,5845,349],{"class":312},[306,5847,5341],{"class":352},[306,5849,326],{"class":312},[306,5851,452],{"class":312},[306,5853,349],{"class":312},[306,5855,5311],{"class":352},[306,5857,326],{"class":312},[306,5859,452],{"class":312},[306,5861,349],{"class":312},[306,5863,5326],{"class":352},[306,5865,326],{"class":312},[306,5867,495],{"class":312},[306,5869,5870],{"class":308,"line":693},[306,5871,1825],{"class":312},[306,5873,5874],{"class":308,"line":714},[306,5875,1830],{"class":312},[306,5877,5878,5880,5882,5884,5886],{"class":308,"line":735},[306,5879,398],{"class":312},[306,5881,1133],{"class":341},[306,5883,326],{"class":312},[306,5885,329],{"class":312},[306,5887,1173],{"class":312},[306,5889,5890],{"class":308,"line":751},[306,5891,1801],{"class":312},[306,5893,5894,5896,5898,5900,5902,5904,5906,5908],{"class":308,"line":766},[306,5895,1806],{"class":312},[306,5897,1621],{"class":401},[306,5899,326],{"class":312},[306,5901,329],{"class":312},[306,5903,349],{"class":312},[306,5905,5543],{"class":352},[306,5907,326],{"class":312},[306,5909,358],{"class":312},[306,5911,5912,5914,5917,5919,5921,5923,5926,5928],{"class":308,"line":771},[306,5913,1806],{"class":312},[306,5915,5916],{"class":401},"orderType",[306,5918,326],{"class":312},[306,5920,329],{"class":312},[306,5922,349],{"class":312},[306,5924,5925],{"class":352},"HISTOGRAM_BUCKET",[306,5927,326],{"class":312},[306,5929,358],{"class":312},[306,5931,5932,5934,5936,5938,5940,5942,5945],{"class":308,"line":789},[306,5933,1806],{"class":312},[306,5935,1601],{"class":401},[306,5937,326],{"class":312},[306,5939,329],{"class":312},[306,5941,349],{"class":312},[306,5943,5944],{"class":352},"ASCENDING",[306,5946,569],{"class":312},[306,5948,5949],{"class":308,"line":1958},[306,5950,1825],{"class":312},[306,5952,5953],{"class":308,"line":1963},[306,5954,1873],{"class":312},[306,5956,5957],{"class":308,"line":1968},[306,5958,1221],{"class":312},[306,5960,5961],{"class":308,"line":1973},[306,5962,1384],{"class":312},[306,5964,5965],{"class":308,"line":1978},[306,5966,792],{"class":312},[61,5968,5970],{"id":5969},"compare-dimensions-with-pivot","Compare dimensions with pivot",[16,5972,5973,5974,1141,5977,5980],{},"Pivot tables help to separate the values of metrics more clearly by two selected dimensions. While it is possible to have an output with multiple dimensions even without the pivot feature (in the so-called long format with a row for each combination of dimensions), the pivot table allows a ",[265,5975,5976],{},"better comparison",[265,5978,5979],{},"of the values within both dimensions",". With the pivot table, you can check how the values change when keeping one of the dimensions the same and changing the other by following either the given rows or columns.",[16,5982,5983],{},"The resulting data have a different structure than the output of a simple query because the pivot table forms an additional object in the data rows. Therefore, to incorporate it into further transformations, the schema and the calculations need to be adjusted.",[16,5985,5986],{},"As an example, we provide an overview of sessions and users by 4 hostnames where the count of users is separated into months between months.",[4754,5988,5989],{},[4757,5990,5991,6013],{},[4760,5992,5993],{},[4763,5994,5995,5997,5999,6001,6003,6005,6007,6009,6011],{},[4766,5996,1141],{},[4766,5998,1141],{},[4766,6000,1141],{},[4766,6002,5308],{},[4766,6004,5316],{},[4766,6006,5323],{},[4766,6008,5331],{},[4766,6010,5338],{},[4766,6012,5346],{},[4777,6014,6015,6053,6084,6115,6146,6175],{},[4763,6016,6017,6019,6024,6029,6033,6037,6041,6045,6049],{},[4782,6018,1141],{},[4782,6020,6021],{},[265,6022,6023],{},"Users",[4782,6025,6026],{},[265,6027,6028],{},"Sessions",[4782,6030,6031],{},[265,6032,6023],{},[4782,6034,6035],{},[265,6036,6023],{},[4782,6038,6039],{},[265,6040,6023],{},[4782,6042,6043],{},[265,6044,6023],{},[4782,6046,6047],{},[265,6048,6023],{},[4782,6050,6051],{},[265,6052,6023],{},[4763,6054,6055,6060,6063,6066,6069,6072,6075,6078,6081],{},[4782,6056,6057],{},[265,6058,6059],{},"hostname 1",[4782,6061,6062],{},"776 000",[4782,6064,6065],{},"1 940 000",[4782,6067,6068],{},"121 000",[4782,6070,6071],{},"118 000",[4782,6073,6074],{},"135 000",[4782,6076,6077],{},"132 000",[4782,6079,6080],{},"142 000",[4782,6082,6083],{},"128 000",[4763,6085,6086,6091,6094,6097,6100,6103,6106,6109,6112],{},[4782,6087,6088],{},[265,6089,6090],{},"hostname 2",[4782,6092,6093],{},"605 000",[4782,6095,6096],{},"1 512 500",[4782,6098,6099],{},"89 000",[4782,6101,6102],{},"91 000",[4782,6104,6105],{},"102 000",[4782,6107,6108],{},"104 000",[4782,6110,6111],{},"112 000",[4782,6113,6114],{},"107 000",[4763,6116,6117,6122,6125,6128,6131,6134,6137,6140,6143],{},[4782,6118,6119],{},[265,6120,6121],{},"hostname 3",[4782,6123,6124],{},"11 500",[4782,6126,6127],{},"28 750",[4782,6129,6130],{},"1 200",[4782,6132,6133],{},"1 800",[4782,6135,6136],{},"1 000",[4782,6138,6139],{},"1 400",[4782,6141,6142],{},"2 100",[4782,6144,6145],{},"4 000",[4763,6147,6148,6153,6156,6159,6162,6165,6167,6170,6173],{},[4782,6149,6150],{},[265,6151,6152],{},"hostname 4",[4782,6154,6155],{},"8 500",[4782,6157,6158],{},"21 250",[4782,6160,6161],{},"1 500",[4782,6163,6164],{},"900",[4782,6166,6130],{},[4782,6168,6169],{},"1 100",[4782,6171,6172],{},"1 700",[4782,6174,6142],{},[4763,6176,6177,6182,6185,6188,6191,6194,6197,6200,6203],{},[4782,6178,6179],{},[265,6180,6181],{},"TOTALS",[4782,6183,6184],{},"1 401 000",[4782,6186,6187],{},"3 502 500",[4782,6189,6190],{},"212 700",[4782,6192,6193],{},"211 700",[4782,6195,6196],{},"239 200",[4782,6198,6199],{},"238 500",[4782,6201,6202],{},"257 800",[4782,6204,6205],{},"241 100",[296,6207,6209],{"className":298,"code":6208,"language":300,"meta":301,"style":301},"{\n  \"reportRequests\": [\n    {\n      \"viewId\": \"XXXXXXXXX\",\n      \"dateRanges\": [\n        {\n          \"startDate\": \"2020-01-01\",\n          \"endDate\": \"yesterday\"\n        }\n      ],\n      \"metrics\": [\n        {\n          \"expression\": \"ga:users\"\n        },\n        {\n          \"expression\": \"ga:sessions\"\n        }\n      ],\n      \"dimensions\": [\n        {\n          \"name\": \"ga:hostname\"\n        }\n      ],\n      \"pivots\": [\n        {\n          \"dimensions\": [\n            {\n              \"name\": \"ga:month\"\n            }\n          ],\n          \"metrics\": [\n            {\n              \"expression\": \"ga:users\"\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n",[303,6210,6211,6215,6227,6231,6249,6261,6265,6283,6299,6303,6307,6319,6323,6339,6343,6347,6363,6367,6371,6383,6387,6404,6408,6412,6424,6428,6440,6444,6460,6464,6469,6481,6485,6501,6505,6510,6514,6518,6522,6526],{"__ignoreMap":301},[306,6212,6213],{"class":308,"line":309},[306,6214,313],{"class":312},[306,6216,6217,6219,6221,6223,6225],{"class":308,"line":316},[306,6218,319],{"class":312},[306,6220,5364],{"class":322},[306,6222,326],{"class":312},[306,6224,329],{"class":312},[306,6226,1173],{"class":312},[306,6228,6229],{"class":308,"line":335},[306,6230,1178],{"class":312},[306,6232,6233,6235,6237,6239,6241,6243,6245,6247],{"class":308,"line":361},[306,6234,398],{"class":312},[306,6236,1409],{"class":341},[306,6238,326],{"class":312},[306,6240,329],{"class":312},[306,6242,349],{"class":312},[306,6244,1418],{"class":352},[306,6246,326],{"class":312},[306,6248,358],{"class":312},[306,6250,6251,6253,6255,6257,6259],{"class":308,"line":382},[306,6252,398],{"class":312},[306,6254,1166],{"class":341},[306,6256,326],{"class":312},[306,6258,329],{"class":312},[306,6260,1173],{"class":312},[306,6262,6263],{"class":308,"line":395},[306,6264,1801],{"class":312},[306,6266,6267,6269,6271,6273,6275,6277,6279,6281],{"class":308,"line":414},[306,6268,1806],{"class":312},[306,6270,1185],{"class":401},[306,6272,326],{"class":312},[306,6274,329],{"class":312},[306,6276,349],{"class":312},[306,6278,5423],{"class":352},[306,6280,326],{"class":312},[306,6282,358],{"class":312},[306,6284,6285,6287,6289,6291,6293,6295,6297],{"class":308,"line":428},[306,6286,1806],{"class":312},[306,6288,1205],{"class":401},[306,6290,326],{"class":312},[306,6292,329],{"class":312},[306,6294,349],{"class":312},[306,6296,5442],{"class":352},[306,6298,569],{"class":312},[306,6300,6301],{"class":308,"line":465},[306,6302,1825],{"class":312},[306,6304,6305],{"class":308,"line":498},[306,6306,1830],{"class":312},[306,6308,6309,6311,6313,6315,6317],{"class":308,"line":504},[306,6310,398],{"class":312},[306,6312,1233],{"class":341},[306,6314,326],{"class":312},[306,6316,329],{"class":312},[306,6318,1173],{"class":312},[306,6320,6321],{"class":308,"line":510},[306,6322,1801],{"class":312},[306,6324,6325,6327,6329,6331,6333,6335,6337],{"class":308,"line":531},[306,6326,1806],{"class":312},[306,6328,1123],{"class":401},[306,6330,326],{"class":312},[306,6332,329],{"class":312},[306,6334,349],{"class":312},[306,6336,1630],{"class":352},[306,6338,569],{"class":312},[306,6340,6341],{"class":308,"line":552},[306,6342,4320],{"class":312},[306,6344,6345],{"class":308,"line":572},[306,6346,1801],{"class":312},[306,6348,6349,6351,6353,6355,6357,6359,6361],{"class":308,"line":578},[306,6350,1806],{"class":312},[306,6352,1123],{"class":401},[306,6354,326],{"class":312},[306,6356,329],{"class":312},[306,6358,349],{"class":312},[306,6360,1511],{"class":352},[306,6362,569],{"class":312},[306,6364,6365],{"class":308,"line":592},[306,6366,1825],{"class":312},[306,6368,6369],{"class":308,"line":613},[306,6370,1830],{"class":312},[306,6372,6373,6375,6377,6379,6381],{"class":308,"line":634},[306,6374,398],{"class":312},[306,6376,1275],{"class":341},[306,6378,326],{"class":312},[306,6380,329],{"class":312},[306,6382,1173],{"class":312},[306,6384,6385],{"class":308,"line":653},[306,6386,1801],{"class":312},[306,6388,6389,6391,6393,6395,6397,6399,6402],{"class":308,"line":658},[306,6390,1806],{"class":312},[306,6392,1119],{"class":401},[306,6394,326],{"class":312},[306,6396,329],{"class":312},[306,6398,349],{"class":312},[306,6400,6401],{"class":352},"ga:hostname",[306,6403,569],{"class":312},[306,6405,6406],{"class":308,"line":672},[306,6407,1825],{"class":312},[306,6409,6410],{"class":308,"line":693},[306,6411,1830],{"class":312},[306,6413,6414,6416,6418,6420,6422],{"class":308,"line":714},[306,6415,398],{"class":312},[306,6417,4474],{"class":341},[306,6419,326],{"class":312},[306,6421,329],{"class":312},[306,6423,1173],{"class":312},[306,6425,6426],{"class":308,"line":735},[306,6427,1801],{"class":312},[306,6429,6430,6432,6434,6436,6438],{"class":308,"line":751},[306,6431,1806],{"class":312},[306,6433,1275],{"class":401},[306,6435,326],{"class":312},[306,6437,329],{"class":312},[306,6439,1173],{"class":312},[306,6441,6442],{"class":308,"line":766},[306,6443,3518],{"class":312},[306,6445,6446,6448,6450,6452,6454,6456,6458],{"class":308,"line":771},[306,6447,3043],{"class":312},[306,6449,1119],{"class":434},[306,6451,326],{"class":312},[306,6453,329],{"class":312},[306,6455,349],{"class":312},[306,6457,5543],{"class":352},[306,6459,569],{"class":312},[306,6461,6462],{"class":308,"line":789},[306,6463,2515],{"class":312},[306,6465,6466],{"class":308,"line":1958},[306,6467,6468],{"class":312},"          ],\n",[306,6470,6471,6473,6475,6477,6479],{"class":308,"line":1963},[306,6472,1806],{"class":312},[306,6474,1233],{"class":401},[306,6476,326],{"class":312},[306,6478,329],{"class":312},[306,6480,1173],{"class":312},[306,6482,6483],{"class":308,"line":1968},[306,6484,3518],{"class":312},[306,6486,6487,6489,6491,6493,6495,6497,6499],{"class":308,"line":1973},[306,6488,3043],{"class":312},[306,6490,1123],{"class":434},[306,6492,326],{"class":312},[306,6494,329],{"class":312},[306,6496,349],{"class":312},[306,6498,1630],{"class":352},[306,6500,569],{"class":312},[306,6502,6503],{"class":308,"line":1978},[306,6504,2515],{"class":312},[306,6506,6507],{"class":308,"line":1991},[306,6508,6509],{"class":312},"          ]\n",[306,6511,6512],{"class":308,"line":1996},[306,6513,1825],{"class":312},[306,6515,6516],{"class":308,"line":2014},[306,6517,1873],{"class":312},[306,6519,6520],{"class":308,"line":2019},[306,6521,1221],{"class":312},[306,6523,6524],{"class":308,"line":2024},[306,6525,1384],{"class":312},[306,6527,6528],{"class":308,"line":2037},[306,6529,792],{"class":312},[61,6531,6533],{"id":6532},"cohorts-to-track-behavioral-time-evolution","Cohorts to track behavioral time evolution",[16,6535,6536,6537,6540,6541,6544,6545,6548,6549],{},"A fourth specific feature of the GA v4 API requests is the introduction of the cohorts and ",[265,6538,6539],{},"lifetime value reports",". While at the moment it only supports the acquisition date (date of their first visit) to separate the cohorts, it already provides meaningful insight by showing ",[265,6542,6543],{},"how users"," from the same day, week, or month ",[265,6546,6547],{},"performed in a selected aspect in comparison to other time cohorts"," during the selected period. You can learn about the behavior in terms of users, sessions, page views, goal completions, and similar cohort-specific metrics. The earlier cohorts are observed for longer, providing the data for more periods. In particular, when observing 3 monthly cohorts for 4 months, there are 4 periods of data for the earliest cohort and 2 periods for the latest. This allows you to compare how all the cohorts are behaving in the month of acquisition as well as in the month after the acquisition. Moreover, you can ",[265,6550,6551],{},"analyze how one cohort evolves over several months.",[4754,6553,6554],{},[4757,6555,6556,6575],{},[4760,6557,6558],{},[4763,6559,6560,6563,6566,6569,6572],{},[4766,6561,6562],{},"Cohort",[4766,6564,6565],{},"Month 0",[4766,6567,6568],{},"Month 1",[4766,6570,6571],{},"Month 2",[4766,6573,6574],{},"Month 3",[4777,6576,6577,6594,6611],{},[4763,6578,6579,6582,6585,6588,6591],{},[4782,6580,6581],{},"2020-03",[4782,6583,6584],{},"165 000",[4782,6586,6587],{},"25 000",[4782,6589,6590],{},"8 400",[4782,6592,6593],{},"4 200",[4763,6595,6596,6599,6602,6605,6608],{},[4782,6597,6598],{},"2020-04",[4782,6600,6601],{},"174 000",[4782,6603,6604],{},"28 000",[4782,6606,6607],{},"9 200",[4782,6609,6610],{}," -",[4763,6612,6613,6616,6619,6622,6624],{},[4782,6614,6615],{},"2020-05",[4782,6617,6618],{},"189 000",[4782,6620,6621],{},"32 000",[4782,6623,6610],{},[4782,6625,6610],{},[296,6627,6629],{"className":298,"code":6628,"language":300,"meta":301,"style":301},"{\n  \"reportRequests\": [\n    {\n      \"viewId\": \"XXXXXXXXX\",\n      \"includeEmptyRows\": true,\n      \"metrics\": [\n        {\n          \"expression\": \"ga:cohortActiveUsers\"\n        }\n      ],\n      \"dimensions\": [\n        {\n          \"name\": \"ga:cohort\"\n        },\n        {\n          \"name\": \"ga:cohortNthMonth\"\n        }\n      ],\n      \"orderBys\": [\n        {\n          \"fieldName\": \"ga:cohort\"\n        }\n      ],\n      \"cohortGroup\": {\n        \"cohorts\": [\n          {\n            \"type\": \"FIRST_VISIT_DATE\",\n            \"name\": \"2020-05-01 to 2020-05-31\",\n            \"dateRange\": {\n              \"startDate\": \"2020-05-01\",\n              \"endDate\": \"2020-05-31\"\n            }\n          },\n          {\n            \"type\": \"FIRST_VISIT_DATE\",\n            \"name\": \"2020-04-01 to 2020-04-30\",\n            \"dateRange\": {\n              \"startDate\": \"2020-04-01\",\n              \"endDate\": \"2020-04-30\"\n            }\n          },\n          {\n            \"type\": \"FIRST_VISIT_DATE\",\n            \"name\": \"2020-03-01 to 2020-03-31\",\n            \"dateRange\": {\n              \"startDate\": \"2020-03-01\",\n              \"endDate\": \"2020-03-31\"\n            }\n          }\n        ]\n      }\n    }\n  ]\n}\n",[303,6630,6631,6635,6647,6651,6669,6683,6695,6699,6716,6720,6724,6736,6740,6757,6761,6765,6782,6786,6790,6802,6806,6822,6826,6830,6843,6855,6859,6878,6897,6909,6928,6945,6949,6954,6958,6976,6995,7007,7026,7043,7047,7051,7055,7073,7092,7104,7123,7140,7144,7148,7152,7156,7160,7164],{"__ignoreMap":301},[306,6632,6633],{"class":308,"line":309},[306,6634,313],{"class":312},[306,6636,6637,6639,6641,6643,6645],{"class":308,"line":316},[306,6638,319],{"class":312},[306,6640,5364],{"class":322},[306,6642,326],{"class":312},[306,6644,329],{"class":312},[306,6646,1173],{"class":312},[306,6648,6649],{"class":308,"line":335},[306,6650,1178],{"class":312},[306,6652,6653,6655,6657,6659,6661,6663,6665,6667],{"class":308,"line":361},[306,6654,398],{"class":312},[306,6656,1409],{"class":341},[306,6658,326],{"class":312},[306,6660,329],{"class":312},[306,6662,349],{"class":312},[306,6664,1418],{"class":352},[306,6666,326],{"class":312},[306,6668,358],{"class":312},[306,6670,6671,6673,6676,6678,6680],{"class":308,"line":382},[306,6672,398],{"class":312},[306,6674,6675],{"class":341},"includeEmptyRows",[306,6677,326],{"class":312},[306,6679,329],{"class":312},[306,6681,6682],{"class":312}," true,\n",[306,6684,6685,6687,6689,6691,6693],{"class":308,"line":395},[306,6686,398],{"class":312},[306,6688,1233],{"class":341},[306,6690,326],{"class":312},[306,6692,329],{"class":312},[306,6694,1173],{"class":312},[306,6696,6697],{"class":308,"line":414},[306,6698,1801],{"class":312},[306,6700,6701,6703,6705,6707,6709,6711,6714],{"class":308,"line":428},[306,6702,1806],{"class":312},[306,6704,1123],{"class":401},[306,6706,326],{"class":312},[306,6708,329],{"class":312},[306,6710,349],{"class":312},[306,6712,6713],{"class":352},"ga:cohortActiveUsers",[306,6715,569],{"class":312},[306,6717,6718],{"class":308,"line":465},[306,6719,1825],{"class":312},[306,6721,6722],{"class":308,"line":498},[306,6723,1830],{"class":312},[306,6725,6726,6728,6730,6732,6734],{"class":308,"line":504},[306,6727,398],{"class":312},[306,6729,1275],{"class":341},[306,6731,326],{"class":312},[306,6733,329],{"class":312},[306,6735,1173],{"class":312},[306,6737,6738],{"class":308,"line":510},[306,6739,1801],{"class":312},[306,6741,6742,6744,6746,6748,6750,6752,6755],{"class":308,"line":531},[306,6743,1806],{"class":312},[306,6745,1119],{"class":401},[306,6747,326],{"class":312},[306,6749,329],{"class":312},[306,6751,349],{"class":312},[306,6753,6754],{"class":352},"ga:cohort",[306,6756,569],{"class":312},[306,6758,6759],{"class":308,"line":552},[306,6760,4320],{"class":312},[306,6762,6763],{"class":308,"line":572},[306,6764,1801],{"class":312},[306,6766,6767,6769,6771,6773,6775,6777,6780],{"class":308,"line":578},[306,6768,1806],{"class":312},[306,6770,1119],{"class":401},[306,6772,326],{"class":312},[306,6774,329],{"class":312},[306,6776,349],{"class":312},[306,6778,6779],{"class":352},"ga:cohortNthMonth",[306,6781,569],{"class":312},[306,6783,6784],{"class":308,"line":592},[306,6785,1825],{"class":312},[306,6787,6788],{"class":308,"line":613},[306,6789,1830],{"class":312},[306,6791,6792,6794,6796,6798,6800],{"class":308,"line":634},[306,6793,398],{"class":312},[306,6795,1133],{"class":341},[306,6797,326],{"class":312},[306,6799,329],{"class":312},[306,6801,1173],{"class":312},[306,6803,6804],{"class":308,"line":653},[306,6805,1801],{"class":312},[306,6807,6808,6810,6812,6814,6816,6818,6820],{"class":308,"line":658},[306,6809,1806],{"class":312},[306,6811,1621],{"class":401},[306,6813,326],{"class":312},[306,6815,329],{"class":312},[306,6817,349],{"class":312},[306,6819,6754],{"class":352},[306,6821,569],{"class":312},[306,6823,6824],{"class":308,"line":672},[306,6825,1825],{"class":312},[306,6827,6828],{"class":308,"line":693},[306,6829,1830],{"class":312},[306,6831,6832,6834,6837,6839,6841],{"class":308,"line":714},[306,6833,398],{"class":312},[306,6835,6836],{"class":341},"cohortGroup",[306,6838,326],{"class":312},[306,6840,329],{"class":312},[306,6842,332],{"class":312},[306,6844,6845,6847,6849,6851,6853],{"class":308,"line":735},[306,6846,431],{"class":312},[306,6848,3463],{"class":401},[306,6850,326],{"class":312},[306,6852,329],{"class":312},[306,6854,1173],{"class":312},[306,6856,6857],{"class":308,"line":751},[306,6858,3026],{"class":312},[306,6860,6861,6863,6865,6867,6869,6871,6874,6876],{"class":308,"line":766},[306,6862,2223],{"class":312},[306,6864,342],{"class":434},[306,6866,326],{"class":312},[306,6868,329],{"class":312},[306,6870,349],{"class":312},[306,6872,6873],{"class":352},"FIRST_VISIT_DATE",[306,6875,326],{"class":312},[306,6877,358],{"class":312},[306,6879,6880,6882,6884,6886,6888,6890,6893,6895],{"class":308,"line":771},[306,6881,2223],{"class":312},[306,6883,1119],{"class":434},[306,6885,326],{"class":312},[306,6887,329],{"class":312},[306,6889,349],{"class":312},[306,6891,6892],{"class":352},"2020-05-01 to 2020-05-31",[306,6894,326],{"class":312},[306,6896,358],{"class":312},[306,6898,6899,6901,6903,6905,6907],{"class":308,"line":789},[306,6900,2223],{"class":312},[306,6902,3702],{"class":434},[306,6904,326],{"class":312},[306,6906,329],{"class":312},[306,6908,332],{"class":312},[306,6910,6911,6913,6915,6917,6919,6921,6924,6926],{"class":308,"line":1958},[306,6912,3043],{"class":312},[306,6914,1185],{"class":3046},[306,6916,326],{"class":312},[306,6918,329],{"class":312},[306,6920,349],{"class":312},[306,6922,6923],{"class":352},"2020-05-01",[306,6925,326],{"class":312},[306,6927,358],{"class":312},[306,6929,6930,6932,6934,6936,6938,6940,6943],{"class":308,"line":1963},[306,6931,3043],{"class":312},[306,6933,1205],{"class":3046},[306,6935,326],{"class":312},[306,6937,329],{"class":312},[306,6939,349],{"class":312},[306,6941,6942],{"class":352},"2020-05-31",[306,6944,569],{"class":312},[306,6946,6947],{"class":308,"line":1968},[306,6948,2515],{"class":312},[306,6950,6951],{"class":308,"line":1973},[306,6952,6953],{"class":312},"          },\n",[306,6955,6956],{"class":308,"line":1978},[306,6957,3026],{"class":312},[306,6959,6960,6962,6964,6966,6968,6970,6972,6974],{"class":308,"line":1991},[306,6961,2223],{"class":312},[306,6963,342],{"class":434},[306,6965,326],{"class":312},[306,6967,329],{"class":312},[306,6969,349],{"class":312},[306,6971,6873],{"class":352},[306,6973,326],{"class":312},[306,6975,358],{"class":312},[306,6977,6978,6980,6982,6984,6986,6988,6991,6993],{"class":308,"line":1996},[306,6979,2223],{"class":312},[306,6981,1119],{"class":434},[306,6983,326],{"class":312},[306,6985,329],{"class":312},[306,6987,349],{"class":312},[306,6989,6990],{"class":352},"2020-04-01 to 2020-04-30",[306,6992,326],{"class":312},[306,6994,358],{"class":312},[306,6996,6997,6999,7001,7003,7005],{"class":308,"line":2014},[306,6998,2223],{"class":312},[306,7000,3702],{"class":434},[306,7002,326],{"class":312},[306,7004,329],{"class":312},[306,7006,332],{"class":312},[306,7008,7009,7011,7013,7015,7017,7019,7022,7024],{"class":308,"line":2019},[306,7010,3043],{"class":312},[306,7012,1185],{"class":3046},[306,7014,326],{"class":312},[306,7016,329],{"class":312},[306,7018,349],{"class":312},[306,7020,7021],{"class":352},"2020-04-01",[306,7023,326],{"class":312},[306,7025,358],{"class":312},[306,7027,7028,7030,7032,7034,7036,7038,7041],{"class":308,"line":2024},[306,7029,3043],{"class":312},[306,7031,1205],{"class":3046},[306,7033,326],{"class":312},[306,7035,329],{"class":312},[306,7037,349],{"class":312},[306,7039,7040],{"class":352},"2020-04-30",[306,7042,569],{"class":312},[306,7044,7045],{"class":308,"line":2037},[306,7046,2515],{"class":312},[306,7048,7049],{"class":308,"line":2042},[306,7050,6953],{"class":312},[306,7052,7053],{"class":308,"line":2060},[306,7054,3026],{"class":312},[306,7056,7057,7059,7061,7063,7065,7067,7069,7071],{"class":308,"line":2065},[306,7058,2223],{"class":312},[306,7060,342],{"class":434},[306,7062,326],{"class":312},[306,7064,329],{"class":312},[306,7066,349],{"class":312},[306,7068,6873],{"class":352},[306,7070,326],{"class":312},[306,7072,358],{"class":312},[306,7074,7075,7077,7079,7081,7083,7085,7088,7090],{"class":308,"line":2070},[306,7076,2223],{"class":312},[306,7078,1119],{"class":434},[306,7080,326],{"class":312},[306,7082,329],{"class":312},[306,7084,349],{"class":312},[306,7086,7087],{"class":352},"2020-03-01 to 2020-03-31",[306,7089,326],{"class":312},[306,7091,358],{"class":312},[306,7093,7094,7096,7098,7100,7102],{"class":308,"line":2075},[306,7095,2223],{"class":312},[306,7097,3702],{"class":434},[306,7099,326],{"class":312},[306,7101,329],{"class":312},[306,7103,332],{"class":312},[306,7105,7106,7108,7110,7112,7114,7116,7119,7121],{"class":308,"line":2080},[306,7107,3043],{"class":312},[306,7109,1185],{"class":3046},[306,7111,326],{"class":312},[306,7113,329],{"class":312},[306,7115,349],{"class":312},[306,7117,7118],{"class":352},"2020-03-01",[306,7120,326],{"class":312},[306,7122,358],{"class":312},[306,7124,7125,7127,7129,7131,7133,7135,7138],{"class":308,"line":2095},[306,7126,3043],{"class":312},[306,7128,1205],{"class":3046},[306,7130,326],{"class":312},[306,7132,329],{"class":312},[306,7134,349],{"class":312},[306,7136,7137],{"class":352},"2020-03-31",[306,7139,569],{"class":312},[306,7141,7142],{"class":308,"line":2109},[306,7143,2515],{"class":312},[306,7145,7146],{"class":308,"line":2114},[306,7147,3414],{"class":312},[306,7149,7150],{"class":308,"line":2131},[306,7151,2660],{"class":312},[306,7153,7154],{"class":308,"line":2136},[306,7155,501],{"class":312},[306,7157,7158],{"class":308,"line":2141},[306,7159,1221],{"class":312},[306,7161,7162],{"class":308,"line":2156},[306,7163,1384],{"class":312},[306,7165,7167],{"class":308,"line":7166},54,[306,7168,792],{"class":312},[11,7170,7172],{"id":7171},"further-additions","Further additions",[16,7174,7175,7176,7179],{},"Among other benefits of the new API v4 belongs the possibility to use ",[265,7177,7178],{},"multiple date ranges",". This simplifies the procedure to compare values in a short time period to some long-term trend which provides you information about how you are performing in a shorter period.",[16,7181,7182,7183,7186],{},"Furthermore, ",[265,7184,7185],{},"multiple segments"," can be included in a single request. Segments can be used to divide data either to pre-constructed groups using segment ID, e.g. new users or to custom specified groups created using segment filters on dimensions. When multiple segments can be included, you can compare groups of observations without the need to construct multiple queries and combine the resulting data. It can be beneficial for example in comparisons of new vs. returning users or in comparisons of users from different browsers.",[11,7188,7190],{"id":7189},"conclusion","Conclusion",[16,7192,7193],{},"To summarise, the new API v4 enriches the features of Google Analytics API and provides you with more ways to optimize the manipulation and display of data. A clearer view of your data helps you reach more informed solutions and detect potential problems sooner. The testing of the new version revealed new options on how to use the reporting and turn it into a business advantage.",[16,7195,7196,7197,7199,7200,7205],{},"Our tool for web analytics validation – ",[265,7198,1074],{}," has the new features implemented. Check out ",[1049,7201,7204],{"href":7202,"rel":7203},"https:\u002F\u002Fwaaila.com",[1053],"the official website"," for more info.",[969,7207,7208],{"link":971,"button":5170},"\nNot sure how to properly use the new features to your advantage? We can help you set it up or create the newest reports for you. Get in touch and find out more.\n",[975,7210,7211],{},"html pre.shiki code .sAklC, html code.shiki .sAklC{--shiki-default:#89DDFF}html pre.shiki code .sJ14y, html code.shiki .sJ14y{--shiki-default:#C792EA}html pre.shiki code .s5Dmg, html code.shiki .s5Dmg{--shiki-default:#FFCB6B}html pre.shiki code .sfyAc, html code.shiki .sfyAc{--shiki-default:#C3E88D}html pre.shiki code .sx098, html code.shiki .sx098{--shiki-default:#F78C6C}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s-wAU, html code.shiki .s-wAU{--shiki-default:#F07178}html pre.shiki code .s9WhI, html code.shiki .s9WhI{--shiki-default:#916B53}",{"title":301,"searchDepth":316,"depth":316,"links":7213},[7214,7220,7221],{"id":5248,"depth":316,"text":5249,"children":7215},[7216,7217,7218,7219],{"id":5279,"depth":335,"text":5280},{"id":5568,"depth":335,"text":5569},{"id":5969,"depth":335,"text":5970},{"id":6532,"depth":335,"text":6533},{"id":7171,"depth":316,"text":7172},{"id":7189,"depth":316,"text":7190},"\u002Fupload\u002Fgoogle-analytics-reporting-api-v4-article-cover.webp",{},"Check out the most complex review of the UA API v4 and what new features it can offer.","\u002Fen\u002Fblog\u002Fnotes-on-new-features-of-google-analytics-reporting-api-v4","2020-07-29T12:00:00.000+00:00",8.185,"9 min read",{"title":5209,"description":301},"en\u002Fblog\u002Fnotes-on-new-features-of-google-analytics-reporting-api-v4","PISPgM4Q8NAU9tz8tY_Bc_ccI8FSTS44J6ldWv_GsPk",1789131823083]