Skip to content

Commit fcaf47e

Browse files
committed
Clean up comments on realtime with minute ranges sample
1 parent c71dc85 commit fcaf47e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

google-analytics-data/src/run_realtime_report_with_minute_ranges.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
use Google\Analytics\Data\V1beta\RunRealtimeReportResponse;
3939

4040
/**
41-
* Runs a realtime report on a Google Analytics 4 property.
41+
* Runs a realtime report on a Google Analytics 4 property. Dimensions field is
42+
* omitted in the query, which results in total values of active users returned
43+
* for each minute range in the report.
44+
*
45+
* Note the `dateRange` dimension added to the report response automatically as
46+
* a result of querying multiple minute ranges.
4247
* @param string $propertyId Your GA-4 Property ID
4348
*/
4449
function run_realtime_report_with_minute_ranges(string $propertyId)
@@ -67,7 +72,6 @@ function run_realtime_report_with_minute_ranges(string $propertyId)
6772
*/
6873
function printRunRealtimeReportWithMinuteRangesResponse(RunRealtimeReportResponse $response)
6974
{
70-
// [START analyticsdata_print_run_realtime_report_response_header]
7175
printf('%s rows received%s', $response->getRowCount(), PHP_EOL);
7276
foreach ($response->getDimensionHeaders() as $dimensionHeader) {
7377
printf('Dimension header name: %s%s', $dimensionHeader->getName(), PHP_EOL);
@@ -80,10 +84,6 @@ function printRunRealtimeReportWithMinuteRangesResponse(RunRealtimeReportRespons
8084
PHP_EOL
8185
);
8286
}
83-
// [END analyticsdata_print_run_realtime_report_response_header]
84-
85-
// [START analyticsdata_print_run_realtime_report_response_rows]
86-
print 'Report result: ' . PHP_EOL;
8787

8888
foreach ($response->getRows() as $row) {
8989
printf(
@@ -92,7 +92,6 @@ function printRunRealtimeReportWithMinuteRangesResponse(RunRealtimeReportRespons
9292
$row->getMetricValues()[0]->getValue()
9393
);
9494
}
95-
// [END analyticsdata_print_run_realtime_report_response_rows]
9695
}
9796
// [END analyticsdata_run_realtime_report_with_minute_ranges]
9897

0 commit comments

Comments
 (0)