campaign budget fields from change event service

183 views
Skip to first unread message

julian selser

unread,
Feb 27, 2023, 6:29:09 AM2/27/23
to Google Ads API and AdWords API Forum
Greetings,

My use case requires obtaining all fields of a campaign and all fields of its campaign budget from the change event service using GAQL, but I cant.

The service allows you to retrieve changes based on CAMPAIGN and CAMPAIGN_BUDGET for change_resource_type but only campaign fields are attributed fields and can be used in the SELECT.

After playing with the service for some time, it seems the most I can retrieve for campaign budgets is their ID and their resource name but its not enough, can you confirm if this can be done at all?

Thanks!

Google Ads API Forum Advisor

unread,
Feb 27, 2023, 11:45:36 AM2/27/23
to julian.s...@gmail.com, adwor...@googlegroups.com

Hi Julian,

Thanks for reaching out to the Google Ads API Support.

Since you mentioned that you can retrieve for campaign budgets their ID and their resource name, then you may note that selectable fields should be from change_event report and it's attributed resources. I highly recommend you to make use of change_event_query_builder here https://developers.google.com/google-ads/api/fields/v13/change_event_query_builder


Also, kindly note that the Change Status provides a means to keep track of which resources have changed within an account within the past 90 days (and optionally time). If a resource had multiple changes during your given time period, then only the latest change is returned.

Let us know if you have any questions.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jH60E:ref

julian selser

unread,
Feb 27, 2023, 12:32:52 PM2/27/23
to Google Ads API and AdWords API Forum
Thanks, no further question.

Let it be documentation for the next interested party: it si not possible to retrieve the budget using the change event service.

Regards

julian selser

unread,
Mar 6, 2023, 9:31:48 AM3/6/23
to Google Ads API and AdWords API Forum
Hello there,

I noticed that not only I cannot get the budget, I dont get a change row for the campaign itself if I change its budget.

Can you confirm this is on purpose? This means I cannot tell if a campaign budget changed at all, even looking at the campaign itself.

Thanks,
Julian

On Monday, February 27, 2023 at 1:45:36 PM UTC-3 Google Ads API Forum Advisor wrote:

Google Ads API Forum Advisor

unread,
Mar 6, 2023, 1:42:06 PM3/6/23
to julian.s...@gmail.com, adwor...@googlegroups.com

Hi Julian, 

Thank you for coming back to us. I hope you are doing well today.

Thank you for giving us an update. Moving forward to your concern, For our team to further compare, investigate, and validate why you are encountering issues, could you please provide us with the complete logs (request and response with request-id) generated on your end? Also, can you provide us with UI screenshots (uncropped) of the data that you are retrieving?

In line with this, if there is no error from Google Ads API (status = 200 OK), then it is successful. However, I also recommend reaching out to the Google Ads product support team for further assistance as they are more equipped to provide information and more knowledgeable on how data is accumulated in the ads account or UI dashboard.

Have a great day.

Regards,

julian selser

unread,
Mar 7, 2023, 3:39:43 PM3/7/23
to Google Ads API and AdWords API Forum
Hey there, 

Thanks for looking into this, Ive attached the before and after pictures of my interaction with the UI on my test account today, note the budget changes from 51 to 52.

Here is the request/response, showing nothing is returned:

Request
-------
MethodName: google.ads.googleads.v11.services.GoogleAdsService/SearchStream
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=5326115615, x-goog-api-client=gl-java/17.0.4.1 gccl/21.0.0 gapic/21.0.0 gax/2.12.2 grpc/1.49.0 pb/3.19.3}
Body: customer_id: "9323719315"
query: "SELECT change_status.resource_name, change_status.last_change_date_time, change_status.resource_status, change_status.resource_type FROM change_status WHERE change_status.last_change_date_time DURING TODAY LIMIT 10000"


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=jRVyQ4IW0Q0jsSRVuNf2DQ,date=Tue, 07 Mar 2023 20:17:19 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000)
Body: null
Failure message: null
Status: Status{code=OK, description=null, cause=null}.

While I can use the change event service and get this info, I'd rather get a single row per object changed in a given time window instead of multiple unsorted field changes. otherwise I have to deduplicate all the ids on top of having to perform another query to get the campaign budgets later, since neither service allows you to retrieve them.

Thanks,
Julian
after.png
before.png

Google Ads API Forum Advisor

unread,
Mar 8, 2023, 1:50:19 AM3/8/23
to julian.s...@gmail.com, adwor...@googlegroups.com

Hi Julian,

Thank you for the reply and providing requested information.

Upon trying it on my end, I can confirm that I can retrieve the change information from the old budget amount of 5100000 to 5200000. You may check and try the sample query below to see this.

SELECT change_event.resource_name, change_event.change_date_time, change_event.change_resource_name, change_event.user_email, change_event.client_type, change_event.change_resource_type, change_event.old_resource, change_event.new_resource, change_event.resource_change_operation, change_event.changed_fields FROM change_event WHERE change_event.change_date_time BETWEEN '20230307' AND '20230308'  LIMIT 5

For validation, you may also check your UI' change history section.

Best regards,

julian selser

unread,
Mar 8, 2023, 7:35:36 AM3/8/23
to Google Ads API and AdWords API Forum
Hi,

As I mentioned in my previous message, I know the change event service can be used but its no good.

Can you confirm this cannot be done through the change status service?

Thanks,
Julian

Google Ads API Forum Advisor

unread,
Mar 8, 2023, 11:24:32 AM3/8/23
to julian.s...@gmail.com, adwor...@googlegroups.com
Hi Julian,

Thank you for returning to us.

Regarding your question, as per this Change Status service guide, kindly note that Change Status provides a means to keep track of which resources have changed within an account over a given time period. If a resource had multiple changes during your given time period, then only the latest change is returned. You can use this to determine if you need to sync your local values in your database with the values that changed during that given time period.

On the other hand, note that if you want the complete field-by-field results with a detailed view similar to the Change History UI, use the Change Event service.

Additionally, please see the below query that I used to retrieve the said change in campaignBudget:

Request:

SELECT change_event.resource_name, change_event.change_date_time, change_event.change_resource_name, change_event.user_email, change_event.client_type, change_event.change_resource_type, change_event.old_resource, change_event.new_resource, change_event.resource_change_operation, change_event.changed_fields FROM change_event WHERE change_event.change_date_time BETWEEN '20230307' AND '20230308'  LIMIT 5

You mentioned that "change event service can be used but its no good", can you provide more context regarding this? Also, can you also provide the request and response with request-id generated on your end when you used the change_event resource?

You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
Reply all
Reply to author
Forward
0 new messages