google / analytics-data
Google Analytics Data Client for PHP
Requires
- php: ^8.0
- google/gax: ^1.34.0
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- dev-main
- v0.20.1
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.1
- v0.17.0
- v0.16.4
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.6
- v0.8.5
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.1
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
- dev-policy-bot-f05b3a38-9f68-4525-bfd7-9462819370ab
- dev-policy-bot-567e3bc9-8aa5-4729-8b58-73e0ba25a497
- dev-policy-bot-134e33ba-5297-43d6-bc8c-82fa8c471140
- dev-bcb-to-fb
This package is auto-updated.
Last update: 2024-11-01 19:37:37 UTC
README
Idiomatic PHP client for Google Analytics Data.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/analytics-data
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php'; use Google\Analytics\Data\V1beta\BetaAnalyticsDataClient; $client = new BetaAnalyticsDataClient(); $response = $client->runReport([ 'property' => 'properties/[YOUR_PROPERTY_ID]' ]); foreach ($response->getRows() as $row) { foreach ($row->getDimensionValues() as $dimensionValue) { print 'Dimension Value: ' . $dimensionValue->getValue() . PHP_EOL; } }
Version
This component is considered beta. As such, it should be expected to be mostly stable and we're working towards a release candidate. We will address issues and requests with a higher priority.
Next Steps
- Understand the official documentation.