Closed dawansv closed 9 years ago
Issue has been fixed in commit ee638cf1e90ecc0bb30bff420f1d2ec096a283da will be released in next version. Thanks
Hi I did all of the new instruction on different sites with PHP 5.3.3, .p12 file exists but
Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed load key file "key.p12". Check if correct p12 format.' in YYY.php:603 Stack trace:
Hi @Makcym,
This issue #118 is relating to a different issue, if you would like to raise this then please create a new issue.
As for your issue, you will need to use a service account, these end in @developer.gserviceaccount.com and need to be created by following these instructions carefully:
GAPI (because now Google Analytics API only supports OAuth2) will require you to create a 'service account' and then download a .P12 file to upload to your application.
This relates to the use of http_build_query in the curlRequest function (line 757 of gapi.class.php)
In some situations, it seems that the default query separtor on a given server is & instead of &. When http_build_query is called without specifying the separator, the default is used, and if it happens to be & then the request fails.
Simple solution is to specify the separator in the call on line 757 of gapi.class.php: curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_variables, '', '&'));