Scripts may work well for you if you manage large campaigns and you or a colleague have scripting skills. You can put these skills to work to make broad changes across your account, saving yourself time. Scripts can also be used to modify multiple accounts through a manager account.
Once you've created a script, you can manage your scripts and review actions taken by scripts within your account.
Note: If you have a top-level manager account with multiple sub-manager accounts with various client accounts, bulk actions owned by the top-level manager will be visible to that account only, and not to any sub-manager or client accounts.
How scripts work
Here are a few ways you can use scripts:
- Use data from external sources to initiate changes. For example, use external conversion data to make bid changes, or external inventory data to pause/unpause keywords as inventory becomes low. Or, read your campaign data and stats to create highly customized reports, output them to a spreadsheet, and graph it over time.
- Take action across multiple elements of your account. For example, if a keyword has been hogging your spend for the day, you can both pause the keyword and increase budget at the same time.
- Make changes across all items in your account. For example, increase the CPC bids by 30% for all keywords that generated over 1000 impressions last week.
- If you manage multiple accounts through a manager account, you can run one script across multiple child accounts to optimize bids, create multi-account reports, and monitor for potential problems (such as fixing broken links or conflicting negative keywords).
If you don't have scripting skills, or prefer a more structured way of making and scheduling changes, you may wish to consider using automated rules.
Liana recently redesigned her floral website, and she's added a cool new landing page that will inspire all her customers to go into a tulip frenzy. Right now, she's defined a keyword final URL for tulip-related keywords on her campaigns to point to http://www.example.com/tulips/BoringOldPage. She can use a script to change all the final URLs for her tulip-related keywords across all campaigns in her account to use http://www.example.com/tulips/FancyNewPage instead.
Creating or running a pre-made script
- Get a summary report of your account performance
- Check that links in your ads are not broken
- Test your bids
Writing your own script
When you're ready to create your script, here's how to add it to your account:
- In your Google Ads account, click the Tools icon .
- Click the Bulk actions drop down in the section menu.
- Click Scripts.
- Click the plus button to create a new script
- In the "Script name" field at the top, name your script.
- If you're not ready to run your script yet, click Save below the editor, or click Preview to see a preview of the results.
- Before previewing or running the changes, you'll get a message asking you to authorize this script to make changes on your account. Click Authorize now above the script editor, then Grant access to confirm this script has the authority to make changes in your account.
- When you're ready, click Run script now below the script editor to do just that.
When you run a script, it will appear in the "Logs" section with information about its progress. You can stop a script by clicking the Stop button next to any running script.
- When in the script editor box, you can click you can click Documentation then select Examples to see example scripts for common actions you might want to set up scripts for. You can then copy in the samples and tweak them for your particular situation.
- Scripts that run for longer than 30 minutes – or 60 minutes for certain types of manager account scripts – will time out. If your script times out, not all of your changes may be completed. To confirm that your script ran without a timeout, please check your logs. If your script timed out, we encourage you to refine it and run it again.
Scheduling a script
Once you've created a script, you can schedule it to run once, daily, weekly or monthly at a certain hour:
- On the “Scripts” page in the "Frequency" column, hover over the frequency value for a script, which is initially blank.
- Click the pencil icon .
- You can choose an exact date, a day of the week, or a day of the month. You can also choose the time you'd like your script to run.
- Click Save.
If you later decide to run your script at a different time, repeat the steps above.
Managing and tracking scripts
After you've created scripts, you'll find them all on the “Scripts” page, which you can find by clicking the tools icon > "Bulk actions" > Scripts.
Next to the name of each script, an icon in the “Status” column will indicate that the script is enabled with a green icon. You can disable a script by clicking Options, then choosing Disable.
To re-enable a script, click the 3-dot icon , then select “Show disabled” to see all disabled scripts. Click Enable to re-enable the script.
You can see logs for actions that your scripts have taken by clicking Script history, then log statements next to any script. You can see when each script ran and what the status was. A more detailed log is available by clicking Changes.
Fixing issues with scripts
If you have any issues writing, editing, or running a script, you can find help on our developers community forum. The forum welcomes advertisers - from beginners to experts - and features a network of experts who can provide guidance and best practices.