Utility library and code samples for working with the Data Manager API and Python.
- Python 3.10+
The google-ads-datamanager-util utility library is published to PyPI.
Install it using pip:
pip install google-ads-datamanager-utilFor complete instructions on setting up API access and installing the client and utility libraries, see the Set up API access and Install a client library guides.
- src/: Source code for the
google-ads-datamanager-utilPyPI package. Use the utilities in the library to help with common tasks like formatting, hashing, encrypting, and encoding data for Data Manager API requests. - samples/: Code samples demonstrating how to construct and send
requests to the Data Manager API using the google-ads-datamanager client
library and the
google-ads-datamanager-utilutility library.
Samples are provided in the samples/ directory, and the samples/sampledata
directory contains samples of input files you can use with the samples.
To run a sample, first install the sample dependencies:
pip install -r samples/requirements.txtThen invoke the sample script using the command line. You can pass arguments to the script in one of two ways:
python3 samples/events/ingest_events.py \
--operating_account_type='GOOGLE_ADS' \
--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, with one argument per line.
--operating_account_type
GOOGLE_ADS
--operating_account_id
<operating_account_id>
--conversion_action_id
<conversion_action_id>
--json_file
</path/to/your/file>
Then, run the sample by passing the file path, prefixed with the @
character.
python3 samples/events/ingest_events.py @/path/to/your/args.txtContributions welcome! See the Contributing Guide.