Sign up for weekly recaps of the ever-changing search marketing landscape.
AdWords Scripts Bulks Up With Bulk File Uploads
AdWords scripts now support bulk uploads to your accounts, and columnist Russell Savage shows how you can use this new functionality to create campaigns, modify accounts and more.
Managers of large AdWords accounts, rejoice! Google recently added the ability to perform bulk uploads using AdWords scripts. This means you can apply massive changes to your MCC without having to write the logic yourself or log into each account you manage. To learn more, check out the AdWords help section on bulk uploads.
Not only does this save you time, but it also solves a long standing issue with scripts: creating campaigns. Using the bulk upload feature and a simple spreadsheet, you can create as many campaigns as you want.
By combining Google Drive and AdWords scripts, we can build an easy system that allows us to automatically apply changes to our accounts using CSV files.
If you are not using Google Drive on your computer, now would be a good time to download and install it. The scripts shown here will still work if you don’t, but it makes opening and updating the CSV files on your computer much easier.
The first thing we are going to need is a simple folder structure that helps us keep everything in order. I find that a root folder specifically for managing bulk uploads containing subfolders for each account you are managing works pretty well.
When you want to make changes to your account, simply drop the spreadsheet into that account’s “To Process” folder and the script will pick it up on the next run, process it, and move it to the “Processed” folder.
We can write an MCC level script to accomplish this. Let’s start with a simple function to help us create folders.
This function will look for the folder we need and if it can’t find it, the function will create it for us.
Now we can write our main function to create and monitor the folders for any new files. If the script finds any, it will load the files into the account using the new bulk upload feature.
As you can see, we start by iterating through all the accounts in the MCC, building out the folder structure (if it is a new account or if this is the first run), and then calling bulk upload to load the file into the account.
One thing to note is that in the code above, I am simply using the .preview() command to load the file and generate a preview of the changes in the AdWords UI. This doesn’t actually make any changes to the account. Once you are satisfied that everything is working correctly, you can switch over to using the .apply() function which will automatically apply the changes to the account.
Another good thing about bulk uploads is that the changes are applied to your account in the background while the script keeps running. According to this post in the forums, the bulk upload will timeout after two hours of processing.
It’s always nice to get notified when there are changes made to your account, so I added a function to send an email to notify me when files are uploaded. The code was simply modified from the error notification in my blog post about running executeInParallel on more than 50 accounts.
And that does it. When we put it all together and schedule the script to run hourly, we should have the ability to place bulk upload spreadsheets into the “To Process” folder and have the changes automatically applied to our account.
This merely scratches the surface of what you can do with this new feature. One of the other cool features is the ability to upload offline conversion data. You can also easily duplicate an entire account and target a different location.
Bulk file uploads will also help you avoid timeout errors on many of your scripts because they process in the background and have different timeouts. What other automations can you think of using the new bulk upload feature?
One Last Note: Anyone attending SMX Munich on March 17th and interested in some hands-on training using scripts should know I will be running a workshop as well as speaking at the conference, and I’d love for you to join me. In the workshop, we will learn how to build AdWords scripts from scratch, writing all the code yourself. We will also have time to debug any problems you have in your existing scripts. I encourage you to sign up if you are interested.
Some opinions expressed in this article may be those of a guest author and not necessarily Search Engine Land. Staff authors are listed here.