googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
295 stars 262 forks source link

Root composer.json requires PHP extension ext-protobuf #986

Closed Enkirch closed 9 months ago

Enkirch commented 9 months ago

Hi, I need to implement this https://developers.google.com/google-ads/api/samples/upload-offline-conversion?hl=en

I am currently working locally with XAMPP/WordPress on Windows.

For the library I have taken this composer.json https://github.com/googleads/google-ads-php/blob/HEAD/composer.json

After composer install, I now only get

Root composer.json requires PHP extension ext-protobuf * but it is missing from your system. Install or enable PHP's protobuf extension.

I have tried for several days to get this to work. But I can't find this extension.

If I install this with

composer install --ignore-platform-req=ext-protobuf

things are downloaded. But then I get

Fatal error: Uncaught Error: Undefined constant Fatal error: Uncaught Error: Class "Google\Ads\GoogleAds\Examples\Utils\ArgumentParser" not found
in D:\xampp-8-1-25\htdocs\xxx\wp-content\themes\xxx\google_upload\UploadOfflineConversion.php on line 75

What am I doing wrong? I can't do more than Composer Install to install everything, can I?

fiboknacky commented 9 months ago

Could you please review Requirements and follow the links there? They'll guide you through installing those necessary extensions.

Enkirch commented 9 months ago

I have problems with "Protobuf". I don't understand where to get the file for my XAMPP installation to call it in the php.ini. that's why I did the following

composer install --ignore-platform-req=ext-protobuf

because it also says "you can skip this step and the PHP implementation will be used instead."

I have stored CUSTOMER_ID and CONVERSION_ACTION_ID in UploadOfflineConversion.php.

I have stored developerToken in the google_ads_php.ini. I don't know where this should be in my WordPress installation: in the root of the theme or in the root of WordPress itself.

But even after composer install i dont have the "files" that i need which are in this file under "use" https://developers.google.com/google-ads/api/samples/upload-offline-conversion?hl=en