Creating Customer with Google Ads API in Laravel

205 views
Skip to first unread message

John Katsabanis

unread,
Oct 30, 2023, 9:43:14 PM10/30/23
to Google Ads API and AdWords API Forum
As the title indicates, I am using the Google Ads API in PHP to programmatically create a new account using laravel for the app framework with the following code in my GoogleAPIcontroller:

Screenshot 2023-10-30 at 4.59.22 PM.png
I keep getting the following error when triggering the above function in the controller:

Screenshot 2023-10-30 at 3.57.55 PM.png

Google Ads API Forum Advisor

unread,
Oct 31, 2023, 4:39:52 AM10/31/23
to john.ka...@ubiweb.ca, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

By reviewing your concern, I understand that you are getting an error while triggering the function.

The error message indicates that the createClient() method in the ClientController class is expecting 3 arguments, but only 2 are being passed in. To fix the error, you need to make sure that you are passing three arguments to the createClient() method. The first argument should be a Request object, the second argument should be a GoogleAdsClient object, and the third argument should be an integer representing the manager's customer ID.

I hope this helps. Please feel free to get back to us if you have any further queries.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02q9KX1:ref"

Thanks,
 
Google Logo Google Ads API Team


John Katsabanis

unread,
Oct 31, 2023, 1:12:35 PM10/31/23
to Google Ads API and AdWords API Forum
Hello and thank you for your reply. Not sure if you received my previous message, but I will reply here. I did as recommended and added int $managerCustomerId to the createClient function:

Screenshot 2023-10-31 at 10.13.27 AM.png

Nevertheless, i am still getting a similar error to before, but now it appears as such:

Screenshot 2023-10-31 at 10.16.06 AM.png


Apologies for the inconvenience, but your feedback is highly appreciated.

Many thanks.

John Katsabanis

unread,
Oct 31, 2023, 1:12:35 PM10/31/23
to Google Ads API and AdWords API Forum

Hello and thank you for your reply. Not sure if you received my previous message, but I will reply here. I did as recommended and added int $managerCustomerId to the createClient function:

Screenshot 2023-10-31 at 10.13.27 AM.png

Nevertheless, i am still getting a similar error to before, but now it appears as such:

Screenshot 2023-10-31 at 10.16.06 AM.png


Apologies for the inconvenience, but your feedback is highly appreciated.

Many thanks.
On Tuesday, October 31, 2023 at 4:39:52 AM UTC-4 Google Ads API Forum Advisor wrote:

John Katsabanis

unread,
Oct 31, 2023, 1:12:37 PM10/31/23
to Google Ads API and AdWords API Forum
Hello, 

Thank you for your input. I have added the 3rd argument as you mentioned in your reply, nevertheless i am getting a similar error:

Screenshot 2023-10-31 at 10.13.27 AM.png

in screenshot above, "int $managerCustomerID was added as advised, now i am getting the following error:

Screenshot 2023-10-31 at 10.16.06 AM.png
On Tuesday, October 31, 2023 at 4:39:52 AM UTC-4 Google Ads API Forum Advisor wrote:

Google Ads API Forum Advisor

unread,
Oct 31, 2023, 7:40:24 PM10/31/23
to john.ka...@ubiweb.ca, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

Upon checking further, I understand that you are having an issue with the Google Ads PHP library when trying to create a new account. Kindly note that the concerns related to the Google Ads PHP library are out of scope for the Google Ads API support team. I would suggest you create a "New issue" with the developer who maintains the PHP client library using this link.
Reply all
Reply to author
Forward
0 new messages