ホームページ  >  に質問  >  本文

PHP でのbatchRunReports メソッドの使用: ガイド

phpでbatchRunReportsを実行する方法を理解したいだけです。例を試してみましたが、複雑な致命的なエラーメッセージが表示されます。ドキュメントを調べましたが、問題に関連するものは何も見つかりませんでした。ドキュメント内のツールを使用して必要なクエリを実行できますが、それを php に渡すことはできません。

リーリー

致命的エラー: キャッチされない例外: Google\Analytics\Data\V1beta\RunReportRequest を予期しています。 F:\xampp\htdocs\other\2_template\api-test-completed\google-analytics\vendor\google\protobuf\src\Google\Protobuf\Internal\GPBUtil.php:198 スタック トレース:

#0 F:\xampp\htdocs\other\2_template\api-test-completed\google-analytics\vendor\google\protobuf\src\Google\Protobuf\Internal\RepeatedField.php(187): Google\Protobuf\Internal \ GPBUtil::checkMessage(Array, 'Google\Analytic...')

#1 F:\xampp\htdocs\other\2_template\api-test-completed\google-analytics\vendor\google \protobuf \src\Google\Protobuf\Internal\GPBUtil.php(210): Google\Protobuf\Internal\RepeatedField->offsetSet(NULL, Array)

#2 F:\xampp\htdocs\other\ 2_template \api-test-completed\google-analytics\vendor\google\analytics-data\src\V1beta\BatchRunReportsRequest.php(126): Google\Protobuf\Internal\GPBUtil::checkRepeatedField(Array, 11, 'Google\Analytic . ..')

#3 F:\xampp\htdocs\other\2_template\api-test-completed\google-analytics\vendor\google\analytics-data\src\V1beta\Gapic\BetaAnalyticsDataGapicClient .php (421): Google\Analytics\Data\V1beta\BatchRunReportsRequest->setRequests(Array)

#4 F:\xampp\htdocs\other\2_template\api-test-completed\google-analytics\ テスト.php(46): Google\Analytics\Data\V1beta\Gapic\BetaAnalyticsDataGapicClient->batchRunReports(Array)

#5 {main} は F:\xampp\htdocs\other\2_template\api-test をスローします-completed\google-analytics\vendor\google\protobuf\src\Google\Protobuf\Internal\GPBUtil.php 行 198

P粉914731066P粉914731066238日前416

全員に返信(1)返信します

  • P粉792026467

    P粉7920264672024-01-30 10:45:43

    batchRunReports を実行するには、「requests」配列の RunReportRequest オブジェクトを使用する必要があります。 batchRunReportsリクエストと同様に「属性」を追加することを忘れないでください。

    リーリー

    返事
    0
  • キャンセル返事