In the past months we have all been working hard to implement our Google Analytics 4 (GA4) environment. Something that we are less accustomed to, is using data streams. A data stream represents a source of incoming data, being web, iOS or Android. Web streams have a measurement ID which is implemented in the Google Analytics 4 tracker to collect data. iOS and Android apps are identified with a Bundle ID or Package Name, respectively. When these apps are used as streams for a property, these identifiers are displayed in the stream configuration.
Many of us manage a GA4 jungle with multiple accounts, multiple properties and lots of streams. Unfortunately, there is no possibility to filter on the previously mentioned stream identifiers in the GA4 UI. Thus, it becomes hard to see what property a certain stream identifier is connected to.
How are we solving this?
Fortunately, Google recently published the Alpha and Beta channels of the Google Analytics Admin API. This API lets you export, create or update GA4 accounts, properties, streams and contents such as custom dimensions and conversions. It is still an early preview version of the API, so it is subject to change. However, a custom setup still gives us a nice overview of all the accounts, properties and streams where we have at least ‘read’ access.
To create a hands-on setup where no technical knowledge is required, we built a couple of functions that can be activated with a single click from a drop-down menu in the sheet. Whereas it takes quite some loading time to load accounts, properties and streams at once, you also have the possibility to either load just the accounts, properties, streams. Additionally, there is a function to clean up the sheet or recreate the tabs in case you mess up. Soon the code will be expanded with functions for retrieving GA4 custom dimensions and conversions.
Please note that over time the UA API that is used in this script might be depreciated. By the time the GA4 Admin API is no longer in Beta version, we will update the script to retrieve the account data with the GA4 Admin API so that it remains functional.