We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
UserProperties::export() returns data in wrong format, which ends with an error
"Unable to parse Measurement Protocol JSON payload. invalid JSON in google.analytics.measurement.Measurement @ user_properties: message google.analytics.measurement.Measurement.UserPropertiesEntry, near 1:333 (offset 332): unexpected character: '['; expected '{'"
The data has to be sent as an key->value paired array/object to analytics' endpoint (as described in its docs).
Suggest alternative to the original lines
public function export(): array { return array_reduce($this->getUserPropertiesList(), function ($last, UserProperty $userProperty) { return array_merge($last, $userProperty->export()); }, []); }
as in the following sample:
public function export(): array { $return = []; foreach ($this->getUserPropertiesList() as $userProperty) { $return[array_keys($userProperty->export())[0]] = array_values($userProperty->export())[0]; } return $return; }
The text was updated successfully, but these errors were encountered:
I'm encountering the same issue.
Sorry, something went wrong.
The changes above by @bnoss fix the issue for me as well: 7d18a73
No branches or pull requests
UserProperties::export() returns data in wrong format, which ends with an error
The data has to be sent as an key->value paired array/object to analytics' endpoint (as described in its docs).
Suggest alternative to the original lines
as in the following sample:
The text was updated successfully, but these errors were encountered: