From 23a6a696330a4099b3c9d9cd363dfdd4c9a4c676 Mon Sep 17 00:00:00 2001 From: Josh Radcliff Date: Mon, 28 Sep 2026 12:58:38 -0400 Subject: [PATCH] docs: highlight package registry publication in README Change-Id: I396697238d78497773a2d8a5c4eb2a066317c6b9 --- README.md | 67 ++++++++++++++++++--------------------------------- composer.json | 2 +- 2 files changed, 24 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 41b092f..a01e691 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,49 @@ -# Data Manager API Utility Library and Samples for PHP +# Data Manager API utility library and samples for PHP + +[![Packagist Version](https://img.shields.io/packagist/v/googleads/data-manager-util.svg)](https://packagist.org/packages/googleads/data-manager-util) Utility library and code samples for working with the [Data Manager API](https://developers.google.com/data-manager/api) and PHP. ## Requirements -* PHP 8.2+ - -## Documentation - -Please refer to our [Developer -Site](https://developers.google.com/data-manager/api/get-started/set-up-access#php) -for documentation on how to install, configure, and use the client library. +- PHP 8.2+ -## Add dependencies to your project +## Setup instructions -To use the utility library in your PHP project, install it using [Composer](https://getcomposer.org/): +The `googleads/data-manager-util` utility library is published to +[Packagist](https://packagist.org/packages/googleads/data-manager-util). Install +it using [Composer](https://getcomposer.org/): ```shell composer require googleads/data-manager-util ``` -### Quickstart - -```php -use Google\Ads\DataManagerUtil\Formatter; -use Google\Ads\DataManagerUtil\Encoding; - -$formatter = new Formatter(); - -// Format, normalize, hash (SHA-256), and hex-encode an email address: -$email = $formatter->processEmailAddress('User.Name@gmail.com', Encoding::Hex); - -// Format, normalize, hash (SHA-256), and hex-encode a phone number: -$phone = $formatter->processPhoneNumber('+1 (800) 555-0100', Encoding::Hex); -``` +For complete instructions on setting up API access and installing the client and +utility libraries, see the +[Set up API access](https://developers.google.com/data-manager/api/devguides/quickstart/set-up-access) +and +[Install a client library](https://developers.google.com/data-manager/api/devguides/quickstart/install-library#php) +guides. ## Repository structure -- [`src/`](src/): Source code for the `googleads/data-manager-util` library. - Follow the instructions above to declare a dependency on `googleads/data-manager-util` - in your project. Use the utilities in the library to help with common tasks like - formatting, normalizing, hashing, and encoding data for Data Manager API requests. +- [`src/`](src/): Source code for the `googleads/data-manager-util` Packagist + package. Use the utilities in the library to help with common tasks like + formatting, normalizing, hashing, and encoding data for Data Manager API + requests. - [`samples/`](samples/): Code samples demonstrating how to construct and send - requests to the Data Manager API using the API client library (`googleads/data-manager`) - and the utility library. - -## Usage - -The `samples/audiences` directory contains example scripts demonstrating how to -ingest audience members. - -* `ingest_audience_members.php`: Shows how to ingest audience members without - encryption. - -Before running the samples, ensure you have set up your Google Cloud project, -enabled the necessary APIs, and configured authentication (e.g., Application -Default Credentials). + requests to the Data Manager API using the + [`googleads/data-manager`](https://packagist.org/packages/googleads/data-manager) + client library and the `googleads/data-manager-util` utility library. ## Run samples To run a sample, invoke the script using the command line. You can pass arguments to the script in one of two ways: -### 1. Explicitly, on the command line +### 1. Explicitly, on the command line ```shell php samples/events/ingest_events.php \ @@ -74,7 +53,7 @@ php samples/events/ingest_events.php \ --json_file='' ``` -### 2. Using an arguments file +### 2. Using an arguments file You can also save arguments in a file. diff --git a/composer.json b/composer.json index c52bb7d..959f14a 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "ads", "utilities" ], - "homepage": "https://developers.google.com/data-manager", + "homepage": "https://developers.google.com/data-manager/api", "license": "Apache-2.0", "support": { "issues": "https://github.com/googleads/data-manager-php/issues",