Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google ads api error #1074

Open
rahulwebsite opened this issue Feb 24, 2025 · 5 comments
Open

Google ads api error #1074

rahulwebsite opened this issue Feb 24, 2025 · 5 comments
Labels
bug Something isn't working triage Need triage

Comments

@rahulwebsite
Copy link

rahulwebsite commented Feb 24, 2025

HI Team,

We are trying to implement the Google Ads API to upload offline conversion data, but we are encountering an error from the API. Could you please check this and let us know the correct approach.

API Error is 404.

Below i have added code.

'customers/' . $customerId . '/conversionActions/' . $conversionActionId, 'conversionDateTime' => $conversionDateTime, 'conversionValue' => $conversionValue, 'currencyCode' => $currencyCode ]; // Convert to JSON $json_payload = json_encode(['operations' => [ [ 'create' => $offline_conversion_data, ], ]]); $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_payload); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Check for errors if ($response === false) { echo "Error in sending request.\n"; exit; } // Print the response (success or failure) echo "Response: " . $response . "\n";
@rahulwebsite rahulwebsite added bug Something isn't working triage Need triage labels Feb 24, 2025
@fiboknacky
Copy link
Member

Hello. The code you share doesn't seem to be related to this client library. Could you please confirm?

@rahulwebsite
Copy link
Author

My php version is 7.2, so this client library is supported.
If not supported, then please suggest any other way.

@fiboknacky
Copy link
Member

Your code uses CURL and other normal PHP commands, not the code of this client library.
Could you please double-check it again?
And the official supported PHP version is PHP 8.
If you wish to use PHP 7.4, please use the branch starting with legacy-.

@rahulwebsite
Copy link
Author

We need to upload offline conversion data on google ads.
so can you please suggest which methods we use.

@fiboknacky
Copy link
Member

Sure. First, please read through Getting Started. Then, you can try running the UploadOfflineConversion example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Need triage
Projects
None yet
Development

No branches or pull requests

2 participants