Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
This has me mystified - reports stopped working, watchdog contains:
Code: 400 - Error: Bad Request - Message: GDatainvalidParameterfiltersInvalid value ''. Values must match the following regular expression: 'ga:.+'
Previously the module was working fine, and I don't *think* I've changed anything. Any ideas?
Comments
Comment #1
jakemac53 CreditAttribution: jakemac53 commentedI have the same error occurring, only happens on one account though which is really weird (I am running reports on well over 50 that all work fine).
Comment #2
Andy Inman CreditAttribution: Andy Inman commentedMaybe it's a problem at the Google end? That message must be coming back from their web-service. Configuration of GA maybe, although my GA reports via the GA web-interface all seem fine.
Comment #3
GreenReaperGoogle is no longer accepting empty parameters, because they do not match the above regular expression. In particular, 'filters' and/or 'segment' are liable to be NULL, which results in a params array like this:
.
Modifying function
queryReportFeed
in GAFeed.lib.inc to avoid including them if they are NULL resolves this situation:I probably didn't need to change the last two, as they are set by default, but might as well be consistent.
The parameter 'dimensions' is also of the ga: form but is checked for null higher in the function, and not added if it is NULL. Similarly, 'sort_metric' will not be used if 'metrics' is set (which it is by default). 'start_date' and 'end_date' may be set to NULL but will not be checked against this regular expression.
Comment #4
GreenReaperChanging this to a critical bug as the module is unusuable in the current state for most use cases.
Comment #5
biblos CreditAttribution: biblos commentedI have the same problem:
Code: 400 - Error: Bad Request - Message: GDatainvalidParameterfiltersInvalid value ''. Values must match the following regular expression: 'ga:.+'
.. and afraid that's not the issue of the module, but most likely - the GAPI.
If you try module (no changes in code) with other domain within the same GA account, it will work fine.
Comment #6
wanjee CreditAttribution: wanjee commented[Removed my message because it added confusion and nothing else.]
Comment #7
rsjaffe CreditAttribution: rsjaffe commentedGetting the same error as others in this thread.
Commenting the line 'segment' => NULL, didn't help.
Comment #8
wanjee CreditAttribution: wanjee commentedProblem disappeared after implementation of #3 solution.
Comment #9
introfini CreditAttribution: introfini commented#3 also worked for me.
Thank you GreenReaper!
Comment #10
rsjaffe CreditAttribution: rsjaffe commented#3 worked for me--using version 7.x of the module.
Comment #11
ScottBaetz CreditAttribution: ScottBaetz commentedAnother success when adopting #3... Please deploy an update, so we may update all sites.
Comment #12
Jawi CreditAttribution: Jawi commented#3 worked for me
Comment #13
Dillibabu CreditAttribution: Dillibabu commented#3 worked for me. Thanks. changed code GAFeed.lib.inc file line #344
Previous code :
Changed code :
Comment #14
grendzy CreditAttribution: grendzy commentedThis just appeared on our site too. Maybe Google made a change in a way that's getting rolled out gradually to all domains.
Comment #15
weseze CreditAttribution: weseze commented#3 fixed it for me to. (Drupal 6)
Comment #16
grendzy CreditAttribution: grendzy commentedFixed in all branches, and a 1.2 release is available.
Comment #17
govind.maloo CreditAttribution: govind.maloo commentedAfter updating to this version (7.x-1.2 ) reporting is not working at all on a watchdog I got following error message :
Code: 400 - Error: Bad Request - Message: GDatainvalidInvalid Value
Comment #18
moskito CreditAttribution: moskito commentedSame of #17 here.
Comment #19
grendzy CreditAttribution: grendzy commentedHuh. My own site seems to get these changes from Google later than others, so I can't yet reproduce it.
Comment #20
farald CreditAttribution: farald commentedConfirmed on 1.2.
Code in 1.2 release, line 349:
We have a custom module that utilizes GAR.
Will google use default values for those last 2 parameters
start_index
andmax_results
if they do not exist?In that case I believe they should be allowed to be empty.
Comment #21
grendzy CreditAttribution: grendzy commentedAccording to https://developers.google.com/analytics/devguides/reporting/core/v3/refe... those parameters are optional, and default to 1 ond 1000 respectively.
Comment #22
xandeadx CreditAttribution: xandeadx commented#3 works
Comment #23
raspberryman CreditAttribution: raspberryman commentedLatest GAFeed.lib.php has #3 and #20 pretty well covered. I'm leaving the 1-1000 counts in for now.
Note to self: More unit/integration tests :)