Documentation: Google Ads Reporting Script

This script, written in the Google Ads JavaScript API, is designed to create a comprehensive report of key PPC metrics for all of a company’s accounts and organize them into a Google Spreadsheet for the reference of the account owner(s).

Features:

  • Automatic report update: can be set to gather new data monthly, weekly, daily, or hourly depending on the needs of the team
  • Gathers key metrics: impressions, clicks, conversions, cost
  • Calculates other useful metrics: click-through rate, daily run rate, projected monthly spend
  • Allows the user to input budget for each account, providing more metrics: remaining budget, suggested daily run rate
  • Conditional formatting to provide an at-a-glance summary of which accounts need to spend more/less

Example output:

This script went through several versions. The initial prototype only outputted the last 30 days’ cost, impressions, clicks, and conversions data, and calculated the remaining budget. Additional features were added after discussions with the PPC team made it clear they would be helpful.

In addition, the code has gone through several alterations, independently of feature additions – mainly to streamline it. For example, in a previous version, metrics were collected daily and added to a sheet, then each column of that sheet was added together to produce a final result in a separate sheet. Now, data is collected as often as is desired, and there are no redundant sheets.

I wish I could post the code for you to use, but this project and its code are proprietary. However, if you’d like me to build something similar for you, feel free to contact me – I’d be happy to discuss!

PDP 2

This week, I rehashed all the basics of Python. Since I haven’t studied it at all in ten years, this was a very useful refresher. (Basically, it seems to me that Python is essentially Java structure with something like JavaScript syntax. This is a huge oversimplification, but hey, it’s an extremely high-level language that I’m using it in an object-oriented way for this purpose. There are demonstrable similarities.)

The course I’m currently using doesn’t go over Python in any great detail, so if you’d like to supplement the Python they teach you, or you’d like to add to your knowledge of the language (since this course teaches only a very limited scope of Python), I highly recommend Learn Python The Hard Way. Python was my first programming language ever, and this was the course I used. It gives you a solid grasp of not just Python but how programming works in general.

In addition to the general Python refresher, I learned about all the libraries that I’ll need to use it to do data science: namely, NumPy, Pandas, SciPy, StatsModels API, MatPlotLib, Seaborn, and SciKitLearn. In combination, these libraries add methods that can import data from a variety of sources including Excel spreadsheets, conveniently calculate and tabulate relevant statistical data, do a variety of regressions and cluster analyses, and display elegant and understandable graphs.

This week, I learned how to do a simple linear regression (least squares). Next week, I’ll learn how to do multiple regressions and cluster analyses! And after that, the real fun begins with deep learning and AI. I’m looking forward to it!

In the future, expect me to start creating some little projects. I can’t do much with what I’ve learned this week, but by next week, I’ll absolutely have something at least moderately interesting, and I’ll absolutely do a nice write-up for it.