Getting campaign optimization data from the API

164 views
Skip to first unread message

Ahmed Rslan

unread,
Apr 20, 2023, 4:47:15 AM4/20/23
to Google Ads API and AdWords API Forum
Hi there,

I'm a new user of the Google Ads API and was wondering if it was possible to get 
the campaigns optimization data (cost, conversions, actual target CPA, ..etc) for multiple campaigns from the API, I can see the data on the dashboard but I can't tell if it is present on the API, the docs aren't clear.

Attached is an image showing a sample campaign and the needed data on the dashboard.

Screenshot 2023-03-18 124448.png

Google Ads API Forum Advisor

unread,
Apr 20, 2023, 9:59:50 AM4/20/23
to ahmed.am...@gmail.com, adwor...@googlegroups.com

Hi Ahmed, 

Thanks for reaching out to the Google Ads API Team. I hope you are doing well today.

Moving forward to your concern, you may see the Google Ads API: Optimization score and recommendations full documentation and guidelines.

In line with this, for us to further check the provided information, can you please provide us with a complete or uncropped screenshot of the data that you are retrieving in Google Ads UI?

Furthermore, you can try to use a campaign report to use an API for pulling your data in campaign fields. If you encounter an issue or error, you may also send us your complete API logs (request and response with request-id) for further investigation.

We do this so that we can provide accurate recommendations. 

If you haven't enabled logging yet, it can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. For REST interface requests, you can enable logging via the curl command by using the -i flag. This will cause the tool to include the HTTP response headers in the output.

You can provide the information via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Reference links:


Have a great day.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2koT1n:ref

Ahmed Rslan

unread,
Apr 24, 2023, 8:17:54 AM4/24/23
to Google Ads API and AdWords API Forum

Hi there, 

Attached is the screenshot you requested, I was wondering if I could get these data points showing in the UI through the API.

And If it were possible I had some follow-ups:

1. What would be an easy way to experiment with getting the data, do I need to use my main accounts or can I experiment with test accounts?
2. Can I get historical data?
3. What is the best way to handle authentication?
4. What if I had multiple accounts?

Thanks in advance  
bidding sim.png
bidding sim 2.png

Google Ads API Forum Advisor

unread,
Apr 24, 2023, 2:42:06 PM4/24/23
to ahmed.am...@gmail.com, adwor...@googlegroups.com

Hello Ahmed,

Thank you for responding back to us.

Would you be able to confirm if the screenshot was referring to bid simulations? If so, you may refer to this documentation on how to Retrieve bid simulations (https://developers.google.com/google-ads/api/docs/bid-simulations/retrieve-bid-simulations). Should you need further assistance from us, would you be able to share to us also the entire screenshot of the UI before you click the campaign in question? Asking this so we can accurately investigate your concern with precise details such as customer ID in used.

With regards to your specific queries

1. What would be an easy way to experiment with getting the data, do I need to use my main accounts or can I experiment with test accounts?

  • This will depend where the data is associated, whether in your main account or test account.

2. Can I get historical data?

3. What is the best way to handle authentication?

4. What if I had multiple accounts?

  • Can you elaborate more on this scenario? What would be your use case?

Ahmed Rslan

unread,
Apr 24, 2023, 5:50:38 PM4/24/23
to Google Ads API and AdWords API Forum

Hi there,

Attached is the document showing the UI before the simulation (by clicking the underlined button).

Can you confirm that the Retrieve bid simulations (https://developers.google.com/google-ads/api/docs/bid-simulations/retrieve-bid-simulations) link you shared would contain all the 
did data show on the UI as the naming is different?

What would be the best way to start experimenting an retrieving the data through the API?

I also had some clarifications/follow-ups:

1. I don't mean the exact data I meant getting this type of data to test if I can get it in the first place, I was viewing the docs on test accounts and it mentioned having 
some limitations on reports data?

4. For example if the Google Gmail account is associated with multiple ads accounts, can I access all accounts through the API?
campaign dashboard.png

Google Ads API Forum Advisor

unread,
Apr 25, 2023, 6:09:40 AM4/25/23
to ahmed.am...@gmail.com, adwor...@googlegroups.com
Hi Ahmed,

Thank you for your reply. Please refer to the answers below:

1. Can you confirm that the Retrieve bid simulations (https://developers.google.com/google-ads/api/docs/bid-simulations/retrieve-bid-simulations) link you shared would contain all the did data show on the UI as the naming is different?
  • If this contains the same fields to the said columns or sections then it will get the same results. However, if you encounter any issues let us know.

2. What would be the best way to start experimenting an retrieving the data through the API?
  • We can suggest checking our Quickstart guide as it explains the workflow process of the Google Ads API. Since the Google Ads API is more on retrieving data from Google Ads UI, you can check this reporting of performance data is an integral part of Google Ads API applications. With the API's flexible reporting options, you can obtain performance data for all resources. Please refer to the links below:


3. I don't mean the exact data I meant getting this type of data to test if I can get it in the first place, I was viewing the docs on test accounts and it mentioned having some limitations on reports data?

4. For example if the Google Gmail account is associated with multiple ads accounts, can I access all accounts through the API?
  • Could you please confirm if you are referring to the access levels in your Google Ads Account? If yes, then the said Google Gmail account has access to the multiple Ads account. The grant access to the Google Ads Account, will be able to select which features the user can impact by assigning an access level. For more information please visit this link: https://support.google.com/google-ads/answer/9978556

Best regards,

Ahmed Rslan

unread,
Apr 25, 2023, 2:43:31 PM4/25/23
to Google Ads API and AdWords API Forum
Hey,

Thanks, I will be testing that and reaching out if I needed further help.

4. What I was asking for is that what if I had a gmail that's invited to multiple ads accounts, in this case, would I be able to query 
the data from all the accounts that this gmail is invited to, assuming I give the app permission of course?

Google Ads API Forum Advisor

unread,
Apr 26, 2023, 3:01:19 AM4/26/23
to ahmed.am...@gmail.com, adwor...@googlegroups.com

Hi Ahmed,

Thank you for the reply.

It will depend on the access provided to you. You may check this article for more information on access levels in Google Ads account.

Note that the OAuth2 credentials generated by the users should inherit the access level provided.

Reply all
Reply to author
Forward
0 new messages