You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the example: $response = $analyticsAdminServiceClient->createProperty($property);
The only parameter passed is $property, within the createProperty() function. There need to be two arguments, the Parent's accountName and the $property Object/Array. Otherwise you end up with :
An error occurred: {
"message": "The value for the 'parent' field was invalid but must be in format 'accounts\/123'.",
"code": 3,
"status": "INVALID_ARGUMENT",
"details": []
}
If you pass the parent AND $property --> createProperty('accounts/123456789', $property); You get the following error:
Uncaught TypeError: Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient::createProperty():
Argument #2 ($optionalArgs) must be of type array, Google\Analytics\Admin\V1alpha\Property given
I have also tried to pass $property by doing the following:
$property = new Property([
'display_name' => 'Zaks Test GA4 Property',
'time_zone' => 'America/Chicago'
]);
Based on the error, I even thought ... hmmm ... Maybe if I create a raw array Like so
An error occurred: Expect Google\Analytics\Admin\V1alpha\Property.
So which is it? Does it need argument #2 to be of type array(), or does it need to be Google\Analytics\Admin\V1alpha\Property?
Please update the example with the correct format in creating an Analytics property, or explain why what I am doing is incorrect, when I am trying to follow the example verbatim.
The text was updated successfully, but these errors were encountered:
When viewing this example:
https://github.com/googleapis/google-cloud-php/blob/main/AnalyticsAdmin/samples/V1alpha/AnalyticsAdminServiceClient/create_property.php
Per the example:
$response = $analyticsAdminServiceClient->createProperty($property);
The only parameter passed is
$property
, within thecreateProperty()
function. There need to be two arguments, the Parent's accountName and the$property
Object/Array. Otherwise you end up with :If you pass the parent AND
$property
-->createProperty('accounts/123456789', $property);
You get the following error:I have also tried to pass
$property
by doing the following:Based on the error, I even thought ... hmmm ... Maybe if I create a raw array Like so
To no avail. Then we just get:
An error occurred: Expect Google\Analytics\Admin\V1alpha\Property.
So which is it? Does it need argument #2 to be of type
array()
, or does it need to beGoogle\Analytics\Admin\V1alpha\Property
?Please update the example with the correct format in creating an Analytics property, or explain why what I am doing is incorrect, when I am trying to follow the example verbatim.
The text was updated successfully, but these errors were encountered: