public static void main(String[] args) throws Exception {
AdWordsServiceLogger.log();
// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
// Get the AdGroupAdService.
AdGroupAdServiceInterface adGroupAdService =
user.getService(AdWordsService.V201306.ADGROUP_AD_SERVICE);
// Create the template elements for the ad. You can refer to
// https://developers.google.com/adwords/api/docs/appendix/templateads
// for the list of available template fields.
TemplateAd clickToDownloadAppAd = new TemplateAd();