googleads / googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP
Apache License 2.0
655 stars 770 forks source link

I am getting error when Run Saved Query on console #450

Closed akashsky44 closed 5 years ago

akashsky44 commented 6 years ago

PHP Fatal error: Uncaught Error: Call to a member function getIsCompatibleWithApiVersion() on null in /var/www/www.example.com/public_html/dfp/examples/Dfp/v201802/ReportService/RunSavedQuery.php:60 Stack trace:

0 /var/www/www.example.com/public_html/dfp/examples/Dfp/v201802/ReportService/RunSavedQuery.php(100): Google\AdsApi\Examples\Dfp\v201802\ReportService\RunSavedQuery::runExample(Object(Google\AdsApi\Dfp\DfpServices), Object(Google\AdsApi\Dfp\DfpSession), 10019354480)

1 /var/www/www.example.com/public_html/dfp/examples/Dfp/v201802/ReportService/RunSavedQuery.php(104): Google\AdsApi\Examples\Dfp\v201802\ReportService\RunSavedQuery::main()

2 {main}

thrown in /var/www/www.example.com/public_html/dfp/examples/Dfp/v201802/ReportService/RunSavedQuery.php on line 60

Compatible Api Version errror getting besides this everything working fine but when used inside Report Service Saved Query I am getting error in v201802, v201711, etc..

fiboknacky commented 6 years ago

Thang, could you please take a look?

thangduo commented 6 years ago

Sure, I'll take a look today.

Thanks, Thang Duong

On Thu, Feb 22, 2018 at 6:58 AM, Thanet Knack Praneenararat < notifications@github.com> wrote:

Thang, could you please take a look?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-php-lib/issues/450#issuecomment-367658952, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJc4yzNTU2PCMNbxnKOxMSU45XtBhWEks5tXVZhgaJpZM4SPLWB .

akashsky44 commented 6 years ago

Hello Thang, I am getting the error with attached in this. when running this saved query on a console where I put query ID in RunSavedQuery.php file.

screenshot from 2018-02-23 12-28-32

Please solve this. and also I want to execute that file in a browser. How to do that Please give me any idea.

Thanks

thangduo commented 6 years ago

The error "Call to a member function getIsCompatibleWithApiVersion() on null" indicates that there is no saved queries returned by the previous function:

$savedQuery = $savedQueryPage->getResults()[0]; // $savedQuery is null and will cause 
                                                // exceptions on subsequent lines

Saved queries are private to the creator user.

If you are using a service account to access a saved query created by a non-service account user, please make sure the saved query is shared with the service account.

Users able to edit

This article has a step by step instruction: https://support.google.com/dfp_premium/answer/6098531?hl=en&ref_topic=7492017

Please let me know if sharing the saved query would fix your issue.

Thanks, Thang Duong

Closing remark: This issue is closed and marked as Invalid because it is not a bug.

akashsky44 commented 6 years ago

Hello Thang,

I already have done that but I am getting the same error on my console screen. It's not fixed my sharing saved query issue. Pleas suggest

thangduo commented 6 years ago

Sorry to hear that you still get the error.

Could you please share your network id and the shared query id?

Thanks, Thang Duong

akashsky44 commented 6 years ago

Network id is 2676262 Shared Query id is 10019354480

thangduo commented 6 years ago

Which user account is the owner of the saved query?

thangduo commented 6 years ago

Please update this thread if this issue is still blocking you.

akashsky44 commented 6 years ago

Another account is owner of saved query. And i am still facing issue.

thangduo commented 6 years ago

I will need to know the name of the account who owns the query in order to reproduce the issue on my end.

Please update this thread with the owner account's name.

akashsky44 commented 6 years ago

Account owner : mindworksceo@gmail.com

akashsky44 commented 6 years ago

Hello Thang, Issue Status?

thangduo commented 6 years ago

Hi Akash,

The report that you are trying to generate has some dimensions that are not compatible with the API. Please try to adjust the dimensions and retry.

Thanks

thangduo commented 6 years ago

Hi Akash,

I am closing this issue due to inactivity.

For reference:

MountainMaster commented 5 years ago

Hi @thangduo

I do have the same problem.

Reports are shared with the service account I am using, but "getSavedQueriesByStatement" gives me results=NULL.

Can you help me with that problem? network id 183 report id e.g. 11137633886

kind regards Tobias

thangduo commented 5 years ago

Hi Tobias,

What is the saved query ID? what is the email address that owns the saved query? Are you able to run the saved query via the UI?

Thanks, Thang Duong

MountainMaster commented 5 years ago

Hi Thang,

I found the problem. I was given report IDs instead of query IDs.

Thanks

khoadd101 commented 4 years ago

Hi Thang,

I'm using API v201911, i have the same error. If i delete filter option: DFP Ad Units (Top Level) from the saved query and run, i received a good result. Please let's me know what wrong? Thanks for your support!

thangduo commented 4 years ago

Hi khoadd101,

Please specify your network id, query id and name of the account who owns the query.

Thanks, Thang Duong

khoadd101 commented 4 years ago

Hi Thang,

Thanks for your support!

Query id=11549385028, network code=93656639 DFP Ad Units (Top Level) dimension/filter is not yet supported in the Ad Manager API v201911? Please check and let me know.

Thanks, Khoadd101