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.
Preview mode, at present time, is a feature that's unique to Google Ads. Calls to other services will proceed as normal. If a script is sending 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; see Execution Info for details.
Caveat: No objects get created, deleted, or modified during preview. As a consequence, certain code will not execute the same way when previewed.
The following snippet will not behave as expected in Preview mode:
// Suppose the adgroup has no keywords. var adGroup = findAnEmptyAdGroup(); // Create a keyword. adGroup.createKeyword("test"); // Fetch all keywords in the ad group. var keywords = adGroup.keywords().get(); // In preview mode, will log "false": keyword was not actually created. // In real execution, will log "true". Logger.log("Are there keywords in the ad group? " + keywords.hasNext());