Data collection automation from Google Ads accounts


Task
We provided contextual advertising and marketplace ads for an online mattress store. In order to save time for data analysis and avoid tedious tasks, we have decided to automate the process of collecting ad data from Google Ads and leads info from Google Analytics.
Solution
We have written a script using the R programming language, which collects data on the cost of each ad campaign via API and enters it into a table in Google Sheets. The second script gathers information about the leads from Google Analytics.
What have we done?
The algorithm groups data by advertising tools and by days. This is a large data chunk from three sites in two regions — the service fills in 18 tables daily, which contain, among other things, data on leads from Google Analytics. This allows you to control expenses, amounts, and target CPA for each campaign.
In addition, the algorithm creates a summary table for monitoring costs and remaining credit. This is especially convenient when the client prefers weekly payments.
Ultimately, the solution helps us briefly demonstrate results and the team effectiveness for a customer.
Results
Automation frees up specialists from performing routine tasks that take 3-4 hours. The algorithm makes daily reports by 9 a.m. so that the agency and the customer's employees can discuss the indicators at project meetings. Unlike humans, the script can function without days off, holidays, sick days, and vacations.

With the help of automation, the customer sees budget expenditures, results, remaining credit, and when funds need to be added. In addition, the solution made it possible to create a transparent project environment for convenient interaction between the agency and the customer.