Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA4 Google API Error when connecting Analytics on Develop Branch #5035

Closed
wpdarren opened this issue Apr 5, 2022 · 3 comments
Closed

GA4 Google API Error when connecting Analytics on Develop Branch #5035

wpdarren opened this issue Apr 5, 2022 · 3 comments
Labels
P0 High priority Type: Bug Something isn't working

Comments

@wpdarren
Copy link
Collaborator

wpdarren commented Apr 5, 2022

Bug Description

On the develop branch, when you connect Google Analytics, an error appears in the console. This was on a new site, first time connecting Google Analytics. No feature flags enabled.

googlesitekit-vendor-e65e374ecce4f9e6a086.js:1          GET https://popucu.us3.instawp.xyz/index.php/wp-json/google-site-kit/v1/modules/analytics-4/data/webdatastreams-batch?propertyIDs%5B0%5D=309709683&_locale=user 500
react_devtools_backend.js:3973 Google Site Kit API Error method:GET datapoint:webdatastreams-batch type:modules identifier:analytics-4 error:""Origin
X-Origin Referer" is not valid header value"

Issue does not occur on latest release.

I am able to go through the setup process and create a new UA and GA4 property.

When I reset the site though and reconnected Google Analytics, the GA4 property was not selected by default.

The screencast below gives you a walk through of the issue.

Unfortunately, it's too big to attach but you can watch it here https://d.pr/v/VFBGdJ

Screenshots

image
image

Steps to reproduce

  1. Create a new site
  2. Connect SK (setup Analytics from the splash screen)
  3. Go through the steps to connect
  4. When you get to the connect service screen for Analytics you will see the errors in the console.

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • No errors should be raised about "invalid header values", particularly for requests that are fulfilled by Google APIs

Implementation Brief

Test Coverage

  • No changes

QA Brief

  • Site Kit API responses should be consistent with the previous release regarding errors that are raised/returned
  • GA4 in particular seems to be sensitive to the changes this issue undoes

Changelog entry

  • N/A
@wpdarren wpdarren added Type: Bug Something isn't working P0 High priority labels Apr 5, 2022
@tofumatt tofumatt assigned tofumatt and aaemnnosttv and unassigned tofumatt Apr 5, 2022
@aaemnnosttv
Copy link
Collaborator

This happened as a result of upgrading guzzlehttp/psr7 in #5002.

As noted on guzzle/psr7#494, the real problem is in the Google API client. A PR was opened and just merged today to fix this although this will of course not be available until the next release of the client libraries.

Accordingly, the initial change should be rolled back until we're able to upgrade both the psr7 package and the Google apiclient once the new version is released.

@aaemnnosttv
Copy link
Collaborator

@felixarntz sending this back to CR with a follow-up PR now that the new version of the client library has been released 🙂

@mohitwp
Copy link
Collaborator

mohitwp commented Apr 7, 2022

QA Update ✅

Verified

  • Console showing no errors about "invalid header values", particularly for requests that are fulfilled by Google APIs.
  • Analytics set up showing default GA4 property when user tried to reconnect analytics after reset or disconnecting the plugin.
  • Verified by creating a new site.
  • Verified by setting up search console and analytics together by checking check box at set up screen.
  • Verified by setting up search console and analytics separately.
  • Verified by edit analytics through settings.
  • Verified after disconnecting and reconnecting analytics.
  • Verified after resetting plugin.

image

image

cc @wpdarren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants