Utilities and code samples for working with the Data Manager API and PHP.
- PHP 8.1+
Please refer to our Developer Site for documentation on how to install, configure, and use this client library.
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).
To run a sample, invoke the script using the command line. You can pass arguments to the script in one of two ways:
php samples/events/ingest_events.php \
--operating_account_type=<operating_account_type> \
--operating_account_id=<operating_account_id> \
--conversion_action_id=<conversion_action_id> \
--json_file='</path/to/your/file>'You can also save arguments in a file.
samples/events/ingest_events.php
--operating_account_type=<operating_account_type>
--operating_account_id=<operating_account_id>
--conversion_action_id=<conversion_action_id>
--json_file='</path/to/your/file>'
Then, run the sample using xargs:
xargs -a /path/to/your/argsfile phpContributions welcome! See the Contributing Guide.