PAID MEDIA

If Time Is Money, This Free Google Ads Budget Script Is Priceless

Time is valuable.

This is one of my catchphrases, and I try to run my life with it.

Since I run my own small digital marketing agency and we only have a small team, we also made this one of our mainstays.

So it’s no surprise to me, and to us as a team, that automation has always been high on the priority list.

It is also because I have always been fascinated by technology and innovation, and I believe that progress is what pushes us forward for the better.

As such, I’ve looked at ways to do things using a different approach.

My automation journey started with macros and VBA

In the past, I used to work for a large online travel agency and my job was to create partner business on the back end. It was a repetitive and boring job. Kind of an endless “copy and paste” task.

That’s when I discovered macros exist.

For those who aren’t familiar, macros are groups of actions that can be recorded as instructions.

When run, the macros will automatically repeat all actions and steps that were recorded in the exact same order.

One advantage is that it can be recorded and used in a large number of environments. One of the most popular uses is spreadsheets – Excel, Google Sheets, etc.

Many years later, we still use macros!

Even with managing my duties for the agency, I still enjoy hands-on handling of accounts – and in particular, working with the operations team.

Recently, we had to complete a very large report for one of our largest clients.

They prefer Excel to any other solution, and we had to design something that could aggregate, “clean,” format, and present data in an insightful way.

While collecting and presenting the data was very easy, “cleaning” it up to maintain a consistent format was quite a challenge since we were dealing with tens of thousands of rows.

This is where macros come to the rescue.

Some sets of instructions I recorded and modified using Visual Basic (VB) – language macros built in – made the task not only possible, but also helped it complete faster, eliminating the risk of human error.

Automation = money

My point is exactly this: if time is money and automation saves time, then automation means money.

All while providing the added benefit of reducing the chance of making mistakes along the process.

It’s easy to see what inspired my fascination with automation.

Some of you reading this column may have come across one of my previous articles here on SEJ: How to Use Google Sheets for Web Scraping and Campaign Building.

Evolution to Google ad scripts

There is a lot of Google Ads script that is written by some of the brightest minds in our industry; Frederick Valais and Daniel Gilbert, to name a few, are among those I consider to be the true pioneers of automation!

But despite searching the internet, in general, I couldn’t find anything that could solve my problem.

Why do we need a new scenario

Here was my issue: At our agency, we have a number of retail clients in the flower delivery industry who run their businesses both online and through their brick-and-mortar stores.

Having helped many of these companies with their advertising campaigns for several years now, we know a lot about customer behavior and buying patterns.

From these thoughts, we have gathered that people tend to mostly order flower deliveries on weekdays, but on weekends it is easier to go to the shops and get a bouquet of fresh flowers.

So we can usually see a decrease in return on ad spend between noon on Friday and afternoon on Sunday.

Usually, people come back online on Sunday evenings, and order delivery for Monday.

But despite all the amazing strides Google has taken with its automatic bid strategies (target ROAS, increase conversions, etc.), most of these customers struggle to maximize ad performance over the weekends, while tending to Return on ad spend peaks at the beginning of a week.

So one of the measures that we’ve taken (according to our clients) is that, led by their performance data, we allocate different budgets, at the campaign level, for each day of the week.

For example, we’d have something like this for Monday:

day campaign budget Weight
Monday Campaign name 1 $150.00 30.00%
Monday Campaign name 2 $85.00 17.00%
Monday Campaign name 3 $162.50 32.50%
Monday Campaign name 4 $62.50 12.50%
Monday Campaign name 5 $40.00 8.00%
the total $500.00 100.00%

And then like this for Friday:

day campaign budget Weight
Friday Campaign name 1 $70.00 20.00%
Friday Campaign name 2 $87.50 25.00%
Friday Campaign name 3 $140.00 40.00%
Friday Campaign name 4 $35.00 10.00%
Friday Campaign name 5 $17.50 5.00%
the total $350.00 100.00%

You can see that not only do we have a lower overall budget, but we also have a different weighting of the budget by campaign.

We needed to be able to change each campaign’s budget to make a different allocation each day of the week.

In fact, there is a way to automate the process directly from Google Ads using Rules. Though, if you have an account in a large number of campaigns, setup can take a significant amount of time and effort.

This is because we will need to either create one rule per campaign, for each day of the week, in order to update the budget amount.

Instead, we will have to create one rule for each day of the week, but with a different line (action) for each campaign.

And no matter how you do it, any of these choices leaves you vulnerable to mistakes along the way.

I assumed it would be easier to have a spreadsheet with budgets broken down, where allowances could be calculated using simple formulas, and entered directly into the platform via a script.

As I mentioned, I searched the internet in general, but couldn’t find anything like that.

Sure, there are a few Google Ads scripts that have been written to manage budgets, mostly to control spending and limit opportunities for overspending, but none that fit our clients’ needs.

Enter your Google Ads budget by script for the day of the week

What the script does should be pretty obvious by now, but to recap, it allows us to use a Google spreadsheet to set budgets by account and campaign for each day of the week.

You then use this information to update the campaign’s daily budget.

Note that this is a script at the MCC level, so if necessary, multiple accounts can be managed through a single document.

Where to download and copy the script

The script is completely free to use, and can be downloaded or copied from the Github gist here.

Screenshot from GitHub, Dec 2022

How to use the script

In order to use the script, you will first need to create a copy of the Google Sheet that is used to feed the budget information from.

This can be done by this connection.

Once you’ve made a copy of the file, you’ll notice four tabs in the document:

  • today – tab where, if a budget is created for the current day, it will be shown, from which the script will take data to process updating budgets
  • distribution – This is the tab where budgets are set for one day, several days, or all days of the week. Here, if necessary, you can use formulas to calculate the amounts allocated for each day of the week, each campaign, and so on.
  • Everything – Main menu for budget allocation. Theoretically, this tab could be superfluous but we added it in order to have a way to double check that budgets are properly divided and allocated. Unless changes are made to the formulas, this tab should be kept. The data in the Today tab is queried from here.
  • changelog – Recent tab, where changes are recorded as soon as they are applied. If a change has been made, the previous and new budget allocations will appear here.
Google ad budgets excel sheetScreenshot from Google Sheets, Dec 2022

The next step is to install the script

As mentioned, this is an MCC script.

In Google Ads, you will need to go to Tools and settings > Joomla actions > texts:

MCC textScreenshot from Google Ads, December 2022

From there, click the plus (+) icon to add new text.

New My Client Center (MCC) script Screenshot from Google Ads, December 2022

For this script to work properly, you’ll need to make sure that “Try new scripts” is enabled (see above).

You will then need to remove the few lines of code that are in the document by default:

MCC textScreenshot from Google Ads, December 2022

At this point, you can proceed to paste the file you copied from the Github gist:

Google Ads budgets by day of the weekScreenshot from Google Ads, December 2022

Customize the script

Before using the script, you must change two variables. This will let the script know where the budget information came from and where to record any changes that were applied.

The two variables are:

  • var sheetId = “ADD-THE-GOOGLE-SHEETS-ID-HERE”
  • var logSheet = SpreadsheetApp. openById(‘ADD-THE-GOOGLE-SHEETS-ID-HERE’). getSheetByName(‘changelog’)

There you will need to replace ADD-THE-GOOGLE-SHEETS-ID-HERE with the Google Sheet ID of the document you created earlier:

Google Ads budgets by day of the weekScreenshot from Google Sheets, Dec 2022

Run the script

You’re almost ready to run the script, but note that you’ll need to grant permission before it can make any changes:

Google Ads accountsScreenshot from Google Ads, December 2022

Once you’ve used your credentials to authorize the script to work for you, run a quick preview to make sure everything works as expected.

At this point, if there are budgets assigned for the current day in the Google Sheets tab named “Today”, you’ll see something like this when you run the script preview:

Google Ads script screenshotScreenshot from Google Ads, December 2022

Whereas in the Google Sheets tab called “Changelog” you will see something similar to this:

Google SheetsScreenshot from Google Sheets, Dec 2022

All changes have been properly applied and recorded!

The last thing to do is schedule the script.

Depending on your needs, you can allow it to run daily, or only on the days you want to make changes.

Conclusion

Just like other Google ad scripts we use regularly, this has helped our team streamline processes and take advantage of automation to save time and resources.

This has enabled our agency to focus on more strategic business and missions.

We hope the drive to innovate and find better ways of working motivates you as much as it motivates us.

More resources:

  • Free Google Ads to dynamically change target ROAS
  • Placement exclusion script to “save money” in Google Ads
  • Top 10 Pay Per Click Trends To Know In 2022


Featured image: BestForBest / Shutterstock

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button