Stay organized with collections
Save and categorize content based on your preferences.
When scripts are executed in preview mode, they make no changes to the actual
campaign data. Instead, script execution shows the changes that would have
been made had the script been executing. Once satisfied with the output, you
can start the live execution of a script or schedule it.
Preview mode is a powerful feature, as it allows you to develop and debug a
script without worrying about erroneous changes being made to your Google Ads
data.
Preview mode only affects calls that use AdsApp as an entry point. Calls to
other services will proceed as normal. For example, if a script is using
MailApp to send an email, it will get sent whether or not the script had been
previewed or executed. Spreadsheets will get updated in both scenarios as
well. A script can find out whether or not it is running in preview mode through
its execution info.
The following snippet will not behave as expected in preview mode:
// Suppose the ad group has no keywords.letadGroup=findAnEmptyAdGroup();// Create a keyword.adGroup.createKeyword("test");// Fetch all keywords in the ad group.letkeywords=adGroup.keywords().get();// In preview mode, will log "false": keyword was not actually created.// In real execution, will log "true".console.log("Are there keywords in the ad group? "+keywords.hasNext());
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[[["Preview mode executes scripts without making actual changes to campaign data, allowing for risk-free testing and debugging."],["It provides a safe environment to develop and refine Google Ads scripts before applying them to live campaigns."],["Scripts in preview mode can still interact with external services like sending emails or updating spreadsheets."],["Certain actions, like creating or modifying objects, will not produce the same results in preview mode as in live execution."],["Scripts can determine whether they are running in preview or live mode using execution information."]]],[]]