site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Upgrade GA4 Admin API to beta

Open aaemnnosttv opened this issue 3 years ago • 2 comments

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-services package 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 corresponding beta versions

Implementation Brief

  • In composer.json:
    • Update google/apiclient-services to TBD.
  • In includes/Modules/Analytics_4.php and tests/phpunit/integration/Modules/Analytics_4Test.php file:
    • Update the imports and usage of the following classes from the Google\Site_Kit_Dependencies\Google\Service\GoogleAnalyticsAdmin namespace accordingly.
    • GoogleAnalyticsAdminV1alphaDataStream -> GoogleAnalyticsAdminV1betaDataStream
    • GoogleAnalyticsAdminV1alphaDataStreamWebStreamData -> GoogleAnalyticsAdminV1betaDataStreamWebStreamData
    • GoogleAnalyticsAdminV1alphaListDataStreamsResponse -> GoogleAnalyticsAdminV1betaListDataStreamsResponse
    • GoogleAnalyticsAdminV1alphaProperty -> GoogleAnalyticsAdminV1betaProperty

Test Coverage

  • Make sure all tests pass.

QA Brief

  • Connect Analytics module with GA4 and UA.
  • See that everything works properly.

Changelog entry

aaemnnosttv avatar Jul 19 '22 19:07 aaemnnosttv

IB ✔️

eugene-manuilov avatar Jul 26 '22 09:07 eugene-manuilov

@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

aaemnnosttv avatar Aug 10 '22 17:08 aaemnnosttv

Hi @kuasha420 and @aaemnnosttv so we have an update on these tickets, are they both still blocked? Thanks!

FlicHollis avatar Nov 13 '22 16:11 FlicHollis

@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.

aaemnnosttv avatar Nov 14 '22 23:11 aaemnnosttv

Thanks so much for the upadate @aaemnnosttv !

FlicHollis avatar Nov 15 '22 09:11 FlicHollis

@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

aaemnnosttv avatar Nov 30 '22 19:11 aaemnnosttv

I just updated the AC and TBD in the IB so this should be good to go now 👍

aaemnnosttv avatar Dec 05 '22 22:12 aaemnnosttv

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

mohitwp avatar Dec 14 '22 10:12 mohitwp