Sync all campaigns of all relevant accounts.

89 views
Skip to first unread message

Nguyen Vien

unread,
Feb 26, 2024, 5:05:53 AM2/26/24
to Google Ads API and AdWords API Forum
Hi, I'm working on synchronizing campaigns from multiple related accounts to my Python server, and the current approach of iterating through each account sequentially and fetch campaigns of it by search_stream is time-consuming. I'm considering using multithreading to parallelize the synchronization process. However, I'm uncertain whether to implement multithreading or multiprocessing in my Django Python server. Could you provide guidance on which approach would be more suitable for my scenario, and what factors should I consider in making this decision for optimal performance and efficiency? And why choose that ? Thanks 


Google Ads API Forum Advisor

unread,
Feb 26, 2024, 10:30:53 AM2/26/24
to viennguye...@gmail.com, adwor...@googlegroups.com
Hi,

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

You can use of BatchJobService can reduce the number of requests sent but its use must be evaluated to see if it's a good fit for your needs. A single job in BatchJobService can operate against a mixed collection of campaigns, ad groups, ads, criteria, labels, and feed items. You can use SearchStream instead of Search whenever possible GoogleAdsService.Search can send multiple paginated requests to download the entire report, GoogleAdsService.SearchStream sends a single request and initiates a persistent connection with the Google Ads API regardless of the report size.

I would recommend you to check this guide Batch Processing for more information.

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

Thanks,
 
Google Logo Google Ads API Team

 

Google Ads API Forum Advisor

unread,
Feb 26, 2024, 11:21:55 AM2/26/24
to viennguye...@gmail.com, adwor...@googlegroups.com
Hi,

Kindly ignore our previous email.

Nguyen Vien

unread,
Feb 26, 2024, 10:37:02 PM2/26/24
to Google Ads API and AdWords API Forum
Thank you for response, have any update for me today? Thanks

Google Ads API Forum Advisor

unread,
Feb 27, 2024, 6:45:08 AM2/27/24
to viennguye...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for getting back to us.

Kindly note that when making a request to the API entails a number of fixed costs, such as round-trip network latency, serialization and deserialization processing, and calls to back-end systems. To lessen the impact of these fixed costs and increase overall performance, most mutate methods in the API are designed to accept an array of operations. I would recommend you to check this guide Best Practices for more information.
Reply all
Reply to author
Forward
0 new messages