Tag Archives: adwords_scripts

Introducing Builders in AdWords Scripts

We are introducing Builders as the standard way to create entities in AdWords scripts. You can use Builders in either synchronous or asynchronous mode. You can also check whether the operation was successful or not, and take appropriate actions depending on the operation’s outcome. The following code snippet shows how to create a keyword using builders.


// Retrieve your ad group.
var adGroup = AdWordsApp.adGroups().get().next();

// Create a keyword operation.
var keywordOperation = adGroup.newKeywordBuilder().
.withCpc(1.2)
.withText("shoes")
.withDestinationUrl("http://www.example.com/shoes")
.build();

// Optional: examine the outcome. The call to isSuccessful()
// will block until the operation completes.
if (keywordOperation.isSuccessful()) {
// Get the result.
var keyword = keywordOperation.getResult();
} else {
// Handle the errors.
var errors = keywordOperation.getErrors();
}
The current release adds builder support for ads and keywords. The existing builders for ad groups and Ad Extensions - phone number, site links and mobile apps have also been standardized. The addSitelink, addPhoneNumber, and addMobileApp methods of AdGroup and Campaign classes will now return the resulting operation.

We are also deprecating the following creation methods. These methods will work fine for now, but they will be sunset in the future. You can learn more about this new feature on our guide. If you have questions or feedback about this feature, let us know on our forum.

AdWords scripts integrates with more Google services

We’re excited to announce the integration of AdWords scripts with even more Google services, dubbed “Advanced APIs”, allowing you to make use of these Google services directly from your scripts. The current release allows you to connect with:
  • Google Analytics: Update your account based on your website’s performance.
  • Youtube Analytics: Update your account based on your videos’ performances.
  • YouTube: Use YouTube trends or other channels stats to update your account.
  • Big Query : Manage, upload and query big data sets to better optimize your account.
  • Fusion Tables: Store, share and query your data information.
  • Calendar: Set campaign check reminders, enable/pause ads based on events.
  • Task: Manage and read from your Gmail tasks to optimize your account.
  • Prediction: Create, train, and query prediction models on your campaign’s performance data as well as external data sets.
To learn more about advanced APIs, refer to our code snippets and guide.

We encourage you to give this new feature a try and tell us what solutions you would like to have or other API you would like us to add.

As usual please let us know your feedback on the forum - bug reports and suggestions to improve the API usability are most welcome.

Change to MccApp.accounts() behavior in AdWords Scripts

In response to your feedback, we are enhancing the MccApp.accounts() method. Starting December 3, 2014, the MccApp.accounts() method will return all accounts (e.g. Express, Video, etc.) that you see when logging in to your MCC account through the AdWords UI instead of just the ordinary AdWords accounts.

Note that once this change is live, your MCC scripts may start getting more accounts when calling the MccApp.accounts() method. You should check your MCC scripts to ensure they can handle the possible extra accounts. You can restrict the accounts that AdWords scripts return by applying an appropriate filter condition in your account selector.

Note that this change doesn’t affect the way other selectors work. For example, you cannot retrieve an AdWords Express campaign by calling AdWordsApp.campaigns() on an AdWords Express account.

If you have questions or feedback about this change, let us know on our developer forum or our Google+ page.

New features in AdWords scripts

We have added the following new features in AdWords scripts.

Ad customizers
AdWords scripts now support ad customizers, a more advanced version of ad params. Ad customizers adapt your text ads to the full context of a search or the webpage someone's viewing, by inserting a customized parameter within the ad. Ad customizers let you customize your ads for each query without having to create a separate ad for each variation.

AdWords scripts allow you to create ad customizer sources, add or update items in the sources, and create parameterized ads. You can also target an ad customizer item to a specific campaign, ad group or keyword, and track the performance of ad customizers using the PLACEHOLDER_FEED_ITEM_REPORT.

To learn more about ad customizers, refer to our code snippets and guide. Also, check out the brand new ad customizers solution that shows how to use this new feature in your account.

v201409 reports
We now support AdWords API v201409 reports in AdWords scripts. See blog post for more details.

Product ads
You can now retrieve your product ads using the ads() method of the ShoppingAdGroup. You can create new product ads using the newAdBuilder() method of ShoppingAdGroup.

We hope you enjoy these new features. If you have any questions about these features or AdWords scripts in general, you can post them on the developer forum.

Support for v201409 Reports in AdWords Scripts

We are announcing support for AdWords API v201409 reports in AdWords scripts. The new version introduces PLACEHOLDER_REPORT, a new report type that allows for retrieval of extension stats.

If you use API versioning in your reports, then you need to modify your code to use v201409 as shown below. If you don’t use API versioning, no code changes are required.

var report = AdWordsApp.report(query, {
apiVersion: 'v201409'
});
If you have any questions about this feature or AdWords Scripts in general, you can post them on our developer forum.

Improvements to labels in AdWords scripts

We have made the following improvements to labels in AdWords scripts based on your feedback:
  • You can now create and remove account labels using AdWords scripts. You can also apply or remove labels on child accounts under an MCC account.
  • You can now retrieve IDs for labels within an AdWords account. This feature comes in handy when you want to limit report results to entities with specific labels, since labels are filtered by label ID. You can see a code snippet here.
We have added new code snippets and updated our labels guide to explain these new features in more detail. If you have questions or feedback about these changes, let us know on our developer forum or our Google+ page.

Sunsetting Login email in AdWords Scripts

We recently announced that we will sunset the login email field in AdWords API. To keep our APIs consistent, we will also sunset the getLoginEmail() method in AdWords scripts on November 5, 2014. We have identified some of the common use cases for this field and have come up with some possible workarounds.

Identifying accounts

When retrieving client accounts, use their Customer IDs instead of login emails to identify the accounts. You can use the getCustomerId() method to retrieve an account’s Customer ID. When available, you may also use the getName() method to retrieve the account’s friendly name. To set an account’s name,
  • Login to your My Client Center account and navigate to My Client Center tab
  • Click on the pencil logo in the corresponding Account’s the Client column
  • Provide a new name, and click the Save button to update the account name
Maintaining customer contacts

You should maintain your customer contacts going forward. If you were relying on the login email field to manage your client contacts, then you can use the getCustomerId() and getLoginEmail() methods to create a mapping from your customer ids to their login emails before November 5, 2014.

Determining access levels of a user in an account

Scripts run with the same access levels as the user who authorized the script. You shouldn’t rely on a login email to figure out a script’s access levels--this is a bad programming practice that makes your script error prone if the user’s account access level changes. Instead, make sure that the script is authorized by a user who has enough access levels as required by the script.

If you have questions or feedback about this change, or a use case we missed, let us know on our developer forum or our Google+ page.

AdWords Scripts now supports Shopping campaigns

We are excited to announce support for Shopping campaigns in AdWords scripts. The current release allows you to work with existing shopping campaigns, create and manage product partitions and run shopping reports. You can learn more about these features on our guide.

We encourage you to give this new API a try and let us know your feedback on the forum - bug reports and suggestions to improve the API usability are most welcome.

AdWords Scripts: isDeleted method is now deprecated

We previously announced on this blog about renaming Status enumeration values in reports for removed objects from DELETED to REMOVED. To keep the rest of the API consistent, we are also renaming the isDeleted method in Campaign and AdGroup objects to isRemoved. The isDeleted method is marked as deprecated, and will continue working until November 30, 2014. To ensure that your scripts continue to work properly, make sure you fix your scripts to use the new method before November 30, 2014.

If you have questions about this change, let us know on our forum. You can also provide feedback via the Google Ads Developers Google+ page.

Support for v201406 reports in AdWords scripts

We are announcing support for AdWords API v201406 reports in AdWords scripts. This version introduces several changes to the reporting columns.

Columns and fields cleanup

We've removed duplicates and changed column and display names in some reports:

Column Name
Change
Comments
ValuePerConvManyPerClick
Removed
Use ValuePerConversionManyPerClick instead.
ValuePerConv
Removed
Use ValuePerConversion instead.
TotalConvValue
Removed
Use ConversionValue instead.
PrimaryUserLogin
Removed
AccountId
Removed
Use ExternalCustomerId as unique account ID instead.
TargetingSetting
Removed
This column is now called IsRestrict and returns a proper boolean value.
NonDeletedAdGroupCount
Removed
New column name is NonRemovedAdGroupCount.
NonDeletedAdGroupCriteriaCount
Removed
New column name is NonRemovedAdGroupCriteriaCount.
NonDeletedCampaignCount
Removed
New column name is NonRemovedCampaignCount.


We also made changes to some enumerations for relevance and consistency:
  • Status value for an enabled object is now ENABLED across all reports. Before, it was ACTIVE for some objects.
  • Removed objects now have a status of REMOVED instead of DELETED.
  • The PRODUCT_LISTING_AD_CLICKS display name has changed from Offer to Product listing ad.
If your scripts use these fields in reports, make sure you fix the AWQL when migrating to the new version of the reporting API. Keep in mind that if you don’t use API versioning in your reports, then your code will now be using reports API version v201406 by default.

New report fields

Several new report fields were introduced:

Report Name
New columns
Campaign Performance Report
ServingStatus
Click Performance Report
UserListId
Product Partition Report
date fields, CampaignName, AdGroupName
Multiple reports
ExternalCustomerId, IsRestrict, BiddingStrategyType
Campaign, AdGroup, Ad, and Keyword Performance Reports
Labels


You can refer to https://developers.google.com/adwords/api/docs/appendix/reports for the list of supported reports and columns.

If you have any questions about this feature or the AdWords scripts in general, you can post them on our developer forum.