site-kit-wp
site-kit-wp copied to clipboard
Upgrade GA4 Admin API to beta
Feature Description
We currently rely on the alpha version of the Analytics Admin API which is necessary for interacting with GA4 properties and data streams. A few days ago, the first beta version of this API was released. Once available in the client services library, this issue is for upgrading to use it.
Note the necessary resources in the client services library are not in main yet, let alone published.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
google/apiclient-servicespackage should be upgraded to the latest published release which includes the new resources for the beta version of the Google Analytics Admin v1 API - All
GoogleAnalyticsAdminV1alpha*classes should be updated to use the correspondingbetaversions
Implementation Brief
- In
composer.json:- Update
google/apiclient-servicestoTBD.
- Update
- In
includes/Modules/Analytics_4.phpandtests/phpunit/integration/Modules/Analytics_4Test.phpfile:- Update the imports and usage of the following classes from the
Google\Site_Kit_Dependencies\Google\Service\GoogleAnalyticsAdminnamespace accordingly. GoogleAnalyticsAdminV1alphaDataStream->GoogleAnalyticsAdminV1betaDataStreamGoogleAnalyticsAdminV1alphaDataStreamWebStreamData->GoogleAnalyticsAdminV1betaDataStreamWebStreamDataGoogleAnalyticsAdminV1alphaListDataStreamsResponse->GoogleAnalyticsAdminV1betaListDataStreamsResponseGoogleAnalyticsAdminV1alphaProperty->GoogleAnalyticsAdminV1betaProperty
- Update the imports and usage of the following classes from the
Test Coverage
- Make sure all tests pass.
QA Brief
- Connect Analytics module with GA4 and UA.
- See that everything works properly.
Changelog entry
IB ✔️
@felixarntz flagging here that this is blocked until the v1beta classes are published in the client services libraries. See https://github.com/googleapis/google-api-php-client-services/tree/main/src/GoogleAnalyticsAdmin
Hi @kuasha420 and @aaemnnosttv so we have an update on these tickets, are they both still blocked? Thanks!
@FlicHollis unfortunately we're still blocked by the upstream libraries not being updated for some reason. This has been escalated internally but we're still waiting for the update.
Thanks so much for the upadate @aaemnnosttv !
@kuasha420 This just in – the v1beta was just added to the client-services library! 🎉
For new additions like this, we've always waited for the tagged release to add them in SK but we should at least be able to start a PR for those changes using a temporary change in the composer.json to pull in dev-master that way we're only waiting on the tagged release upstream before we can merge this.
cc: @felixarntz
I just updated the AC and TBD in the IB so this should be good to go now 👍
QA Update ✅
- Verified on dev.
- Verified analytics set up.
- Connected analytics with and without GA4.
- Verified connect and disconnect analytics functionality.
- Verified analytics widget and data.
- Verified GA4 activation banner set up.
- I've noticed that GA4 shows wrong measurement id under settings when we create new web data stream for the existing property. For this we already have ticket - #6293