Last week, a PPC Redditor asked a great question:
“What’s your process for building and testing a script?”
The key word here is ‘process.’ You need to have a process first before you can start automating the (sub)tasks.
So, the first step would be to think deeply about the task you want to automate, and to document every step in the process.
Let’s say you want to make sure all ad groups have live ads. In this case, ask yourself:
1. Why do I want this?
2. What do I need for this?
3. How can I get the things I need?
Potential answers (simplified):
1. I don’t want disapprovals or manual mistakes (e.g., accidentally pausing entities) to stop me from showing ads.
2. I need to continuously make sure all my ad groups have at least one enabled keyword and one enabled ad (that is eligible to run).
3. For every enabled ad group, I need to check the status of my keywords and the status of my ads, and be in the know when an enabled ad group has zero enabled keywords or zero enabled ads. This check needs to happen all the time.
The second step would be to start writing functions to automate the parts of the process you have described.
In our example, you would create a function to check if an ad group has at least one enabled keyword. You would also create a function to check if an ad group has at least one enabled (eligible) ad running. Then, you would write a function that goes over all enabled ad groups, and uses these functions to check keywords and ads. You would also have another function to alert you (i.e., via email). That function would get called if one of your checks failed.
The third step would be to test the different functions and then preview the script. For the testing, I always recommend testing them individually first and then using the Logger.log function to see intermediate results. Then, previewing instead of ‘running’ the script already will make sure the script does not make any changes in your account, so you are sure the script does not F things up.
After previewing, if you are happy with the results, you can then schedule the script to run hourly.
Google Ads Scripting all starts with your process.
Think hard about your current PPC tasks that take up most of your time or are error-prone. Write them down. Be very specific in your documentation. Divide tasks into subtasks. Then, start scripting.
– Nils