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 lets you 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](https://developers.google.com/google-ads/scripts/docs/troubleshooting/execution-info).

> [!IMPORTANT]
> **Important:** No objects are created, deleted, or modified during preview. As a consequence, certain code won't execute the same way in preview mode.

The following snippet won't behave as expected in preview mode:

    // Suppose the ad group has no keywords.
    let adGroup = findAnEmptyAdGroup();

    // Create a keyword.
    adGroup.createKeyword("test");

    // Fetch all keywords in the ad group.
    let keywords = adGroup.keywords().get();

    // In preview mode, this will log "false" since the keyword was not actually created.
    // In real execution, this will log "true".
    console.log("Are there keywords in the ad group? " + keywords.hasNext());