We are glad to announce the following new features in AdWords scripts.
1. Ad Rotation settings
AdWords supports an ad rotation setting that determines which ad in your ad group should show when you have multiple ads in your campaign. You can now access and modify this setting through the getAdRotationType and setAdRotationType methods of the Campaign object. When setting the adRotationType, you can use the string values OPTIMIZE
, CONVERSION_OPTIMIZE
, ROTATE
, or ROTATE_FOREVER
.
2. Support for identifying entity types
We now support a getEntityType method on all the AdWords entity classes like Campaign , AdGroup , etc. This method will return the name of the type, and can be used to identify the type of the object. E.g.
var campaign = AdWordsApp.getCampaignByName(
"My campaign").get().next();
Logger.log(campaign.getEntityType()); // prints "Campaign"
3. Retrieve deleted objects
You may now retrieve deleted objects and their stats by explicitly requesting them in your AWQL. E.g. The following code snippet retrieves all deleted campaigns.
var deletedCampaigns = AdWordsApp.campaigns()
.withCondition("Status='DELETED'").get();
Note that for backward compatibility purposes, we do not return deleted objects by default.
We hope you enjoy these new features. If you have questions or feedback, please visit us on our official forum .
Anash P. Oommen, AdWords Scripts Team