diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ApproveMerchantCenterLink.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ApproveMerchantCenterLink.java index d67d0544fe..53b2559c83 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ApproveMerchantCenterLink.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ApproveMerchantCenterLink.java @@ -108,7 +108,7 @@ private void runExample( // Center account with merchantCenterAccountId. try (MerchantCenterLinkServiceClient merchantCenterLinkService = googleAdsClient.getLatestVersion().createMerchantCenterLinkServiceClient()) { - // [START ApproveMerchantCenterLink] + // [START approve_merchant_center_link] ListMerchantCenterLinksResponse response = merchantCenterLinkService.listMerchantCenterLinks( ListMerchantCenterLinksRequest.newBuilder() @@ -118,14 +118,14 @@ private void runExample( System.out.printf( "%d Merchant Center link(s) found with the following details:%n", response.getMerchantCenterLinksCount()); - // [END ApproveMerchantCenterLink] + // [END approve_merchant_center_link] for (MerchantCenterLink merchantCenterLink : response.getMerchantCenterLinksList()) { - // [START ApproveMerchantCenterLink_1] + // [START approve_merchant_center_link_1] System.out.printf( "Link '%s' has status '%s'.%n", merchantCenterLink.getResourceName(), merchantCenterLink.getStatus()); - // [END ApproveMerchantCenterLink_1] + // [END approve_merchant_center_link_1] // Checks if there is a link for the Merchant Center account we are looking for, then only // approves the link if it is in a 'PENDING' state. @@ -151,7 +151,7 @@ private void runExample( * @param status the new status to set on the link. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START ApproveMerchantCenterLink_2] + // [START approve_merchant_center_link_2] private void updateMerchantCenterLinkStatus( MerchantCenterLinkServiceClient merchantCenterLinkServiceClient, long customerId, @@ -183,5 +183,5 @@ private void updateMerchantCenterLinkStatus( "Updated Merchant Center link with resource name: '%s'.%n", merchantCenterLinkResult.getResourceName()); } - // [END ApproveMerchantCenterLink_2] + // [END approve_merchant_center_link_2] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/CreateCustomer.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/CreateCustomer.java index 0bff1179aa..e362853f4f 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/CreateCustomer.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/CreateCustomer.java @@ -82,7 +82,7 @@ public static void main(String[] args) { } } - // [START CreateCustomer] + // [START create_customer] private void runExample(GoogleAdsClient googleAdsClient, Long managerId) { // Formats the current date/time to use as a timestamp in the new customer description. String dateTime = ZonedDateTime.now().format(DateTimeFormatter.RFC_1123_DATE_TIME); @@ -110,5 +110,5 @@ private void runExample(GoogleAdsClient googleAdsClient, Long managerId) { response.getResourceName(), managerId); } } - // [END CreateCustomer] + // [END create_customer] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/GetChangeSummary.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/GetChangeSummary.java index bd9a8b30a5..3a0d2562fe 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/GetChangeSummary.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/GetChangeSummary.java @@ -82,7 +82,7 @@ public static void main(String[] args) { * @param googleAdsClient the client instance. * @param customerId the customerId for which to retrieve change status. */ - // [START GetAccountChanges] + // [START get_account_changes] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { String query = "SELECT change_status.resource_name, " @@ -123,7 +123,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END GetAccountChanges] + // [END get_account_changes] /** * Each returned row contains all possible changed fields. This function returns the resource name diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/LinkManagerToClient.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/LinkManagerToClient.java index f8dc94ad97..f1d9e74350 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/LinkManagerToClient.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/LinkManagerToClient.java @@ -92,7 +92,7 @@ public static void main(String[] args) throws IOException { } /** Runs the example. */ - // [START LinkManagerToClient] + // [START link_manager_to_client] private void runExample(GoogleAdsClient googleAdsClient, long clientCustomerId, long managerId) { // This example assumes that the same credentials will work for both customers, but that may not // be the case. If you need to use different credentials for each customer, then you may either @@ -164,5 +164,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long clientCustomerId, response.getResults(0).getResourceName()); } } - // [END LinkManagerToClient] + // [END link_manager_to_client] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ListAccessibleCustomers.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ListAccessibleCustomers.java index 10a0318240..fcb6ee2547 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ListAccessibleCustomers.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/ListAccessibleCustomers.java @@ -67,7 +67,7 @@ public static void main(String[] args) { * * @param client the GoogleAdsClient instance to use. */ - // [START ListAccessibleCustomers] + // [START list_accessible_customers] private void runExample(GoogleAdsClient client) { // Optional: Change credentials to use a different refresh token, to retrieve customers // available for a specific user. @@ -94,5 +94,5 @@ private void runExample(GoogleAdsClient client) { } } } - // [END ListAccessibleCustomers] + // [END list_accessible_customers] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/RejectMerchantCenterLink.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/RejectMerchantCenterLink.java index 54a6256220..4f914ceff8 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/RejectMerchantCenterLink.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/accountmanagement/RejectMerchantCenterLink.java @@ -144,7 +144,7 @@ private void runExample( * @param merchantCenterLink the MerchantCenterLink object to remove. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START RejectMerchantCenterLink] + // [START reject_merchant_center_link] private void removeMerchantCenterLink( MerchantCenterLinkServiceClient merchantCenterLinkServiceClient, long customerId, @@ -163,5 +163,5 @@ private void removeMerchantCenterLink( System.out.printf( "Removed Merchant Center link with resource name: '%s'.%n", result.getResourceName()); } - // [END RejectMerchantCenterLink] + // [END reject_merchant_center_link] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdCustomizer.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdCustomizer.java index b1d942021b..06f8e47e5e 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdCustomizer.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdCustomizer.java @@ -185,7 +185,7 @@ private void runExample(GoogleAdsClient googleAdsClient, AddAdCustomizerParams p * @param feedName the name of the feed to create. * @return the resource name of the newly created feed. */ - // [START AddAdCustomizer] + // [START add_ad_customizer] private String createAdCustomizerFeed( GoogleAdsClient googleAdsClient, long customerId, String feedName) { @@ -221,7 +221,7 @@ private String createAdCustomizerFeed( return feedResourceName; } } - // [END AddAdCustomizer] + // [END add_ad_customizer] /** * Retrieves all the attributes for a feed and returns them in a map using the attribute names as @@ -232,7 +232,7 @@ private String createAdCustomizerFeed( * @param feedResourceName the resource name of the feed. * @return the attributes of the feed. */ - // [START AddAdCustomizer_1] + // [START add_ad_customizer_1] private Map getFeedAttributes( GoogleAdsClient googleAdsClient, long customerId, String feedResourceName) { String query = @@ -265,7 +265,7 @@ private Map getFeedAttributes( } return feedAttributes; } - // [END AddAdCustomizer_1] + // [END add_ad_customizer_1] /** * Creates a feed mapping and sets the feed as an ad customizer feed. @@ -275,7 +275,7 @@ private Map getFeedAttributes( * @param feedResourceName the resource name of the feed. * @param feedAttributes the attributes of the feed. */ - // [START AddAdCustomizer_2] + // [START add_ad_customizer_2] private void createAdCustomizerMapping( GoogleAdsClient googleAdsClient, long customerId, @@ -327,7 +327,7 @@ private void createAdCustomizerMapping( "Added feed mapping with resource name %s.%n", response.getResults(0).getResourceName()); } } - // [END AddAdCustomizer_2] + // [END add_ad_customizer_2] /** * Creates two different feed items to enable two different ad customizations. @@ -338,7 +338,7 @@ private void createAdCustomizerMapping( * @param feedAttributes the attributes of the feed. * @return the resource names of the feed items. */ - // [START AddAdCustomizer_3] + // [START add_ad_customizer_3] private List createFeedItems( GoogleAdsClient googleAdsClient, long customerId, @@ -381,7 +381,7 @@ private List createFeedItems( return feedItemResourceNames; } } - // [END AddAdCustomizer_3] + // [END add_ad_customizer_3] /** * Helper function to create a FeedItemOperation. @@ -393,7 +393,7 @@ private List createFeedItems( * @param feedAttributes the attributes to be set on the feed. * @return a FeedItemOperation to create a feed item. */ - // [START AddAdCustomizer_4] + // [START add_ad_customizer_4] private FeedItemOperation createFeedItemOperation( String name, String price, @@ -428,7 +428,7 @@ private FeedItemOperation createFeedItemOperation( return FeedItemOperation.newBuilder().setCreate(feedItem).build(); } - // [END AddAdCustomizer_4] + // [END add_ad_customizer_4] /** * Restricts the feed items to work only with a specific ad group; this prevents the feed items @@ -440,7 +440,7 @@ private FeedItemOperation createFeedItemOperation( * @param adGroupIds the ad group IDs to bind the feed items to. * @param feedItemResourceNames the resource names of the feed items. */ - // [START AddAdCustomizer_5] + // [START add_ad_customizer_5] private void createFeedItemTargets( GoogleAdsClient googleAdsClient, long customerId, @@ -475,7 +475,7 @@ private void createFeedItemTargets( } } } - // [END AddAdCustomizer_5] + // [END add_ad_customizer_5] /** * Creates expanded text ads that use the ad customizer feed to populate the placeholders. @@ -485,7 +485,7 @@ private void createFeedItemTargets( * @param adGroupIds the ad group IDs in which to create the ads. * @param feedName the name of the feed. */ - // [START AddAdCustomizer_6] + // [START add_ad_customizer_6] private void createAdsWithCustomizations( GoogleAdsClient googleAdsClient, long customerId, List adGroupIds, String feedName) { @@ -532,5 +532,5 @@ private void createAdsWithCustomizations( } } } - // [END AddAdCustomizer_6] + // [END add_ad_customizer_6] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdGroupBidModifier.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdGroupBidModifier.java index f7335dee8b..5f078fd1c6 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdGroupBidModifier.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddAdGroupBidModifier.java @@ -104,7 +104,7 @@ public static void main(String[] args) { * @param bidModifier the bid modifier value to set * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddAdGroupBidModifier] + // [START add_ad_group_bid_modifier] private void runExample( GoogleAdsClient googleAdsClient, long customerId, long adGroupId, double bidModifier) { @@ -135,5 +135,5 @@ private void runExample( } } } - // [END AddAdGroupBidModifier] + // [END add_ad_group_bid_modifier] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicPageFeed.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicPageFeed.java index 963365eafc..22c80521d7 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicPageFeed.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicPageFeed.java @@ -363,7 +363,7 @@ private static void createFeedItems( * @param feedResourceName the resource name of the feed. * @param campaignId the campaign ID of the campaign to update. */ - // [START AddDynamicPageFeed_1] + // [START add_dynamic_page_feed_1] private static void updateCampaignDsaSetting( GoogleAdsClient googleAdsClient, long customerId, String feedResourceName, long campaignId) { // Retrieves the existing dynamic search ads settings for the campaign. @@ -397,7 +397,7 @@ private static void updateCampaignDsaSetting( "Updated campaign with resource name '%s'.%n", response.getResults(0).getResourceName()); } } - // [END AddDynamicPageFeed_1] + // [END add_dynamic_page_feed_1] /** * Returns the DSA settings for a campaign. Throws an error if the campaign does not exist or is @@ -408,7 +408,7 @@ private static void updateCampaignDsaSetting( * @param campaignId the campaign ID of the campaign to update. * @return the DSA settings for the campaign. */ - // [START AddDynamicPageFeed] + // [START add_dynamic_page_feed] private static DynamicSearchAdsSetting getDsaSetting( GoogleAdsClient googleAdsClient, long customerId, long campaignId) { // Creates the query. @@ -459,7 +459,7 @@ private static DynamicSearchAdsSetting getDsaSetting( .getDynamicSearchAdsSetting(); } } - // [END AddDynamicPageFeed] + // [END add_dynamic_page_feed] /** * Creates an ad group criterion targeting the DSA label. @@ -469,7 +469,7 @@ private static DynamicSearchAdsSetting getDsaSetting( * @param adGroupId the ad group ID. * @param dsaPageUrlLabel the label for the DSA page URLs. */ - // [START AddDynamicPageFeed_2] + // [START add_dynamic_page_feed_2] private static void addDsaTarget( GoogleAdsClient googleAdsClient, long customerId, long adGroupId, String dsaPageUrlLabel) { String adGroupResourceName = ResourceNames.adGroup(customerId, adGroupId); @@ -515,5 +515,5 @@ private static void addDsaTarget( response.getResults(0).getResourceName()); } } - // [END AddDynamicPageFeed_2] + // [END add_dynamic_page_feed_2] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicSearchAds.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicSearchAds.java index 179b3624ab..578905b353 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicSearchAds.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddDynamicSearchAds.java @@ -164,7 +164,7 @@ private static String addCampaignBudget(GoogleAdsClient googleAdsClient, long cu * @param budgetResourceName the campaign budget resource name. * @return the campaign resource name. */ - // [START AddDynamicSearchAds] + // [START add_dynamic_search_ads] private static String addCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName) { // Creates the campaign. @@ -202,7 +202,7 @@ private static String addCampaign( return campaignResourceName; } } - // [END AddDynamicSearchAds] + // [END add_dynamic_search_ads] /** * Adds an ad group. @@ -212,7 +212,7 @@ private static String addCampaign( * @param campaignResourceName the campaign resource name. * @return the ad group resource name. */ - // [START AddDynamicSearchAds_1] + // [START add_dynamic_search_ads_1] private static String addAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates the ad group. @@ -241,7 +241,7 @@ private static String addAdGroup( return adGroupResourceName; } } - // [END AddDynamicSearchAds_1] + // [END add_dynamic_search_ads_1] /** * Adds an expanded dynamic search ad. @@ -250,7 +250,7 @@ private static String addAdGroup( * @param customerId the client customer ID. * @param adGroupResourceName the ad group resource name. */ - // [START AddDynamicSearchAds_2] + // [START add_dynamic_search_ads_2] private static void addExpandedDSA( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) { // Creates an ad group ad. @@ -283,7 +283,7 @@ private static void addExpandedDSA( "Added ad group ad with resource name '%s'.%n", response.getResults(0).getResourceName()); } } - // [END AddDynamicSearchAds_2] + // [END add_dynamic_search_ads_2] /** * Adds webpage targeting criteria for the DSA. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddSmartDisplayAd.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddSmartDisplayAd.java index d5e626147c..0e65e535b2 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddSmartDisplayAd.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddSmartDisplayAd.java @@ -177,7 +177,7 @@ private void runExample( * @param customerId the client customer ID. * @return the campaign budget resource name. */ - // [START AddSmartDisplayAd] + // [START add_smart_display_ad] private static String createCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) { // Creates the budget. CampaignBudget campaignBudget = @@ -204,7 +204,7 @@ private static String createCampaignBudget(GoogleAdsClient googleAdsClient, long return budgetResourceName; } } - // [END AddSmartDisplayAd] + // [END add_smart_display_ad] /** * Adds a Smart Display campaign. @@ -214,7 +214,7 @@ private static String createCampaignBudget(GoogleAdsClient googleAdsClient, long * @param budgetResourceName the campaign budget resource name. * @return the campaign resource name. */ - // [START AddSmartDisplayAd_1] + // [START add_smart_display_ad_1] private static String createSmartDisplayCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName) { // Creates the campaign. @@ -253,7 +253,7 @@ private static String createSmartDisplayCampaign( return campaignResourceName; } } - // [END AddSmartDisplayAd_1] + // [END add_smart_display_ad_1] /** * Adds an ad group. @@ -263,7 +263,7 @@ private static String createSmartDisplayCampaign( * @param campaignResourceName the campaign resource name. * @return the ad group resource name. */ - // [START AddSmartDisplayAd_4] + // [START add_smart_display_ad_4] private static String createAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates the ad group. @@ -289,7 +289,7 @@ private static String createAdGroup( return adGroupResourceName; } } - // [END AddSmartDisplayAd_4] + // [END add_smart_display_ad_4] /** * Adds a responsive display ad, which is a recommended ad type for Smart Display campaigns. @@ -302,7 +302,7 @@ private static String createAdGroup( * @param squareMarketingImageAssetResourceName optional, the resource name of the square * marketing image asset. */ - // [START AddSmartDisplayAd_2] + // [START add_smart_display_ad_2] private static void createResponsiveDisplayAd( GoogleAdsClient googleAdsClient, long customerId, @@ -367,7 +367,7 @@ private static void createResponsiveDisplayAd( "Added ad group ad with resource name '%s'.%n", response.getResults(0).getResourceName()); } } - // [END AddSmartDisplayAd_2] + // [END add_smart_display_ad_2] /** * Creates an image asset to be used for creating ads. @@ -378,7 +378,7 @@ private static void createResponsiveDisplayAd( * @param imageName the image name. * @return the created image asset's resource name. */ - // [START AddSmartDisplayAd_3] + // [START add_smart_display_ad_3] private static String createImageAsset( GoogleAdsClient googleAdsClient, long customerId, String imageUrl, String imageName) throws IOException { @@ -405,5 +405,5 @@ private static String createImageAsset( return imageResourceName; } } - // [END AddSmartDisplayAd_3] + // [END add_smart_display_ad_3] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/UsePortfolioBiddingStrategy.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/UsePortfolioBiddingStrategy.java index 634e29bb28..15c9c9ff4a 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/UsePortfolioBiddingStrategy.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/UsePortfolioBiddingStrategy.java @@ -133,7 +133,7 @@ private void runExample( * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START UsePortfolioBiddingStrategy_1] + // [START use_portfolio_bidding_strategy_1] private String createBiddingStrategy(GoogleAdsClient googleAdsClient, long customerId) { try (BiddingStrategyServiceClient biddingStrategyServiceClient = googleAdsClient.getLatestVersion().createBiddingStrategyServiceClient()) { @@ -161,7 +161,7 @@ private String createBiddingStrategy(GoogleAdsClient googleAdsClient, long custo return mutateBiddingStrategyResult.getResourceName(); } } - // [END UsePortfolioBiddingStrategy_1] + // [END use_portfolio_bidding_strategy_1] /** * Creates an explicit budget to be used only to create the campaign. @@ -170,7 +170,7 @@ private String createBiddingStrategy(GoogleAdsClient googleAdsClient, long custo * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START UsePortfolioBiddingStrategy] + // [START use_portfolio_bidding_strategy] private String createSharedCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) { try (CampaignBudgetServiceClient campaignBudgetServiceClient = googleAdsClient.getLatestVersion().createCampaignBudgetServiceClient()) { @@ -199,7 +199,7 @@ private String createSharedCampaignBudget(GoogleAdsClient googleAdsClient, long return mutateCampaignBudgetResult.getResourceName(); } } - // [END UsePortfolioBiddingStrategy] + // [END use_portfolio_bidding_strategy] /** * Create a Campaign with a portfolio bidding strategy. @@ -224,7 +224,7 @@ private String createCampaignWithBiddingStrategy( .setTargetSearchNetwork(true) .setTargetContentNetwork(true) .build(); - // [START UsePortfolioBiddingStrategy_2] + // [START use_portfolio_bidding_strategy_2] Campaign campaign = Campaign.newBuilder() .setName("Interplanetary Cruise #" + getPrintableDateTime()) @@ -234,7 +234,7 @@ private String createCampaignWithBiddingStrategy( .setAdvertisingChannelType(AdvertisingChannelType.SEARCH) .setNetworkSettings(networkSettings) .build(); - // [END UsePortfolioBiddingStrategy_2] + // [END use_portfolio_bidding_strategy_2] // Constructs an operation that will create a campaign. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); // Sends the operation in a mutate request. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddCampaigns.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddCampaigns.java index 64cf911c31..5a029de174 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddCampaigns.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddCampaigns.java @@ -102,7 +102,7 @@ public static void main(String[] args) { * @return resource name of the newly created budget. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddCampaigns] + // [START add_campaigns] private static String addCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) { CampaignBudget budget = CampaignBudget.newBuilder() @@ -123,7 +123,7 @@ private static String addCampaignBudget(GoogleAdsClient googleAdsClient, long cu return budgetResourceName; } } - // [END AddCampaigns] + // [END add_campaigns] /** * Runs the example. @@ -149,7 +149,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setTargetPartnerSearchNetwork(false) .build(); - // [START AddCampaigns_1] + // [START add_campaigns_1] // Creates the campaign. Campaign campaign = Campaign.newBuilder() @@ -168,7 +168,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd")) .setEndDate(new DateTime().plusDays(30).toString("yyyyMMdd")) .build(); - // [END AddCampaigns_1] + // [END add_campaigns_1] CampaignOperation op = CampaignOperation.newBuilder().setCreate(campaign).build(); operations.add(op); diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddExpandedTextAds.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddExpandedTextAds.java index d3ca7e531f..4cbd860292 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddExpandedTextAds.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/AddExpandedTextAds.java @@ -97,7 +97,7 @@ public static void main(String[] args) { * @param adGroupId the ad group ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddExpandedTextAds] + // [START add_expanded_text_ads] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long adGroupId) { String adGroupResourceName = ResourceNames.adGroup(customerId, adGroupId); @@ -143,5 +143,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a } } } - // [END AddExpandedTextAds] + // [END add_expanded_text_ads] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateAdGroup.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateAdGroup.java index 1d18bc331f..5b175ae236 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateAdGroup.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateAdGroup.java @@ -47,7 +47,7 @@ private static class UpdateAdGroupParams extends CodeSampleParams { private Long cpcBidMicroAmount; } - // [START UpdateAdGroup] + // [START update_ad_group] public static void main(String[] args) { UpdateAdGroupParams params = new UpdateAdGroupParams(); if (!params.parseArguments(args)) { @@ -90,7 +90,7 @@ public static void main(String[] args) { System.exit(1); } } - // [END UpdateAdGroup] + // [END update_ad_group] /** * Runs the example. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateExpandedTextAd.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateExpandedTextAd.java index bbff8f098c..69b62857ea 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateExpandedTextAd.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/UpdateExpandedTextAd.java @@ -91,7 +91,7 @@ public static void main(String[] args) { * @param customerId the customer ID to update. * @param adId the ad ID to update. */ - // [START UpdateExpandedTextAd] + // [START update_expanded_text_ad] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long adId) { // Creates an AdOperation to update an ad. AdOperation.Builder adOperation = AdOperation.newBuilder(); @@ -128,5 +128,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a } } } - // [END UpdateExpandedTextAd] + // [END update_expanded_text_ad] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/AddAccountBudgetProposal.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/AddAccountBudgetProposal.java index e73f3a2b42..e9e7cd8ddd 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/AddAccountBudgetProposal.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/AddAccountBudgetProposal.java @@ -85,7 +85,7 @@ public static void main(String[] args) { } } - // [START AddAccountBudgetProposal] + // [START add_account_budget_proposal] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long billingSetupId) { // Creates an AccountBudgetProposal. This will be reviewed offline by Google Ads, and if // approved will become an AccountBudget. @@ -135,5 +135,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long b "Account budget proposal created: %s.%n", response.getResult().getResourceName()); } } - // [END AddAccountBudgetProposal] + // [END add_account_budget_proposal] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/GetBillingSetup.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/GetBillingSetup.java index b258add636..0019c90dc7 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/GetBillingSetup.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/GetBillingSetup.java @@ -83,7 +83,7 @@ public static void main(String[] args) { * @param googleAdsClient the Google Ads API client. * @param customerId the customer ID for which to retrieve BillingSetups. */ - // [START GetBillingSetup] + // [START get_billing_setup] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Defines a GAQL query to retrieve all billing setup information. String searchQuery = @@ -135,5 +135,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END GetBillingSetup] + // [END get_billing_setup] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/RemoveBillingSetup.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/RemoveBillingSetup.java index 34711b2d66..81ee076c95 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/RemoveBillingSetup.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/billing/RemoveBillingSetup.java @@ -90,7 +90,7 @@ public static void main(String[] args) { * @param customerId the customer ID containing the BillingSetup to remove. * @param billingSetupId the BillingSetup ID to remove. */ - // [START RemoveBillingSetup] + // [START remove_billing_setup] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long billingSetupId) { // Formats the customerId and billingSetupId into a resource name. String billingSetupResourceName = ResourceNames.billingSetup(customerId, billingSetupId); @@ -110,5 +110,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long b response.getResult().getResourceName()); } } - // [END RemoveBillingSetup] + // [END remove_billing_setup] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignBidModifier.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignBidModifier.java index c58437d7ee..d449345486 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignBidModifier.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignBidModifier.java @@ -118,7 +118,7 @@ private void runExample( CampaignBidModifierOperation op = CampaignBidModifierOperation.newBuilder().setCreate(campaignBidModifier).build(); - // [START MutableResource] + // [START mutable_resource] // Constructs a request to add the bid modifier. MutateCampaignBidModifiersRequest request = MutateCampaignBidModifiersRequest.newBuilder() @@ -151,6 +151,6 @@ private void runExample( mutableResource.getBidModifier(), mutableResource.getCampaign()); } - // [END MutableResource] + // [END mutable_resource] } } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignLabels.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignLabels.java index 4bba4e47a0..5d14fa30e7 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignLabels.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCampaignLabels.java @@ -100,7 +100,7 @@ public static void main(String[] args) throws IOException { * @param labelId the ID of the label to attach to campaigns. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddCampaignLabels] + // [START add_campaign_labels] private void runExample( GoogleAdsClient googleAdsClient, long customerId, List campaignIds, Long labelId) { // Gets the resource name of the label to be added across all given campaigns. @@ -131,5 +131,5 @@ private void runExample( } } } - // [END AddCampaignLabels] + // [END add_campaign_labels] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCompleteCampaignsUsingBatchJob.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCompleteCampaignsUsingBatchJob.java index bbd03829e5..ea652507f7 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCompleteCampaignsUsingBatchJob.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/AddCompleteCampaignsUsingBatchJob.java @@ -152,7 +152,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { * @param customerId the client customer ID. * @return the resource name of the created mutate job. */ - // [START AddCompleteCampaignsUsingBatchJob] + // [START add_complete_campaigns_using_batch_job] private String createBatchJob(BatchJobServiceClient batchJobServiceClient, long customerId) { BatchJobOperation operation = BatchJobOperation.newBuilder().setCreate(BatchJob.newBuilder().build()).build(); @@ -165,7 +165,7 @@ private String createBatchJob(BatchJobServiceClient batchJobServiceClient, long return batchJobResourceName; } - // [END AddCompleteCampaignsUsingBatchJob] + // [END add_complete_campaigns_using_batch_job] /** * Adds all mutate job operations to the mutate job. As this is the first time for this mutate @@ -177,7 +177,7 @@ private String createBatchJob(BatchJobServiceClient batchJobServiceClient, long * @param batchJobResourceName the resource name of mutate job to which the mutate job operations * will be added. */ - // [START AddCompleteCampaignsUsingBatchJob_1] + // [START add_complete_campaigns_using_batch_job_1] private void addAllBatchJobOperations( BatchJobServiceClient batchJobServiceClient, long customerId, String batchJobResourceName) { AddBatchJobOperationsResponse response = @@ -194,7 +194,7 @@ private void addAllBatchJobOperations( "Next sequence token for adding next operations is '%s'.%n", response.getNextSequenceToken()); } - // [END AddCompleteCampaignsUsingBatchJob_1] + // [END add_complete_campaigns_using_batch_job_1] /** * Requests the API to run the mutate job for executing all uploaded mutate job operations. @@ -203,7 +203,7 @@ private void addAllBatchJobOperations( * @param batchJobResourceName the resource name of mutate job to be run. * @return the operation response from running mutate job. */ - // [START AddCompleteCampaignsUsingBatchJob_2] + // [START add_complete_campaigns_using_batch_job_2] private OperationFuture runBatchJob( BatchJobServiceClient batchJobServiceClient, String batchJobResourceName) { OperationFuture operationResponse = @@ -213,7 +213,7 @@ private OperationFuture runBatchJob( return operationResponse; } - // [END AddCompleteCampaignsUsingBatchJob_2] + // [END add_complete_campaigns_using_batch_job_2] /** * Polls the server until the mutate job execution finishes by setting the total time to wait @@ -221,7 +221,7 @@ private OperationFuture runBatchJob( * * @param operationResponse the operation response used to poll the server. */ - // [START AddCompleteCampaignsUsingBatchJob_3] + // [START add_complete_campaigns_using_batch_job_3] private void pollBatchJob(OperationFuture operationResponse) { try { operationResponse.get(MAX_TOTAL_POLL_INTERVAL_SECONDS, TimeUnit.SECONDS); @@ -230,7 +230,7 @@ private void pollBatchJob(OperationFuture operationResponse) { System.exit(1); } } - // [END AddCompleteCampaignsUsingBatchJob_3] + // [END add_complete_campaigns_using_batch_job_3] /** * Prints all the results from running the mutate job. @@ -238,7 +238,7 @@ private void pollBatchJob(OperationFuture operationResponse) { * @param batchJobServiceClient the mutate job service client. * @param batchJobResourceName the resource name of mutate job to get its results. */ - // [START AddCompleteCampaignsUsingBatchJob_4] + // [START add_complete_campaigns_using_batch_job_4] private void fetchAndPrintResults( BatchJobServiceClient batchJobServiceClient, String batchJobResourceName) { System.out.printf( @@ -266,7 +266,7 @@ private void fetchAndPrintResults( : batchJobResult.getMutateOperationResponse().getResponseCase()); } } - // [END AddCompleteCampaignsUsingBatchJob_4] + // [END add_complete_campaigns_using_batch_job_4] /** * Builds all operations for creating a complete campaign and return an array of their diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/GetCampaignsByLabel.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/GetCampaignsByLabel.java index 121e1bf214..8023db7f43 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/GetCampaignsByLabel.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/campaignmanagement/GetCampaignsByLabel.java @@ -89,7 +89,7 @@ public static void main(String[] args) throws IOException { * @param labelId the label ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START GetCampaignsByLabel] + // [START get_campaigns_by_label] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long labelId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { @@ -124,5 +124,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long l } } } - // [END GetCampaignsByLabel] + // [END get_campaigns_by_label] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleExpandedTextAdPolicyViolations.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleExpandedTextAdPolicyViolations.java index 463b761634..bee6e1de5e 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleExpandedTextAdPolicyViolations.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleExpandedTextAdPolicyViolations.java @@ -148,7 +148,7 @@ public void runExample(GoogleAdsClient googleAdsClient, long customerId, long ad * @param gae the Google Ads exception. * @return the ignorable policy topics. */ - // [START HandleExpandedTextAdPolicyViolations] + // [START handle_expanded_text_ad_policy_violations] private List fetchIgnorablePolicyTopics(GoogleAdsException gae) { System.out.println("Google Ads failure details:"); @@ -187,7 +187,7 @@ private List fetchIgnorablePolicyTopics(GoogleAdsException gae) { } return ignorableTopics; } - // [END HandleExpandedTextAdPolicyViolations] + // [END handle_expanded_text_ad_policy_violations] /** * Sends exemption requests for creating an expanded text ad. @@ -197,7 +197,7 @@ private List fetchIgnorablePolicyTopics(GoogleAdsException gae) { * @param operation operation which generated original violations. * @param customerID the customer ID to operate on. */ - // [START HandleExpandedTextAdPolicyViolations_1] + // [START handle_expanded_text_ad_policy_violations_1] private void requestExemption( List ignorablePolicyTopics, AdGroupAdServiceClient client, @@ -225,5 +225,5 @@ private void requestExemption( + " violation exemption.%n", response.getResults(0).getResourceName()); } - // [END HandleExpandedTextAdPolicyViolations_1] + // [END handle_expanded_text_ad_policy_violations_1] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleKeywordPolicyViolations.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleKeywordPolicyViolations.java index ebb2867e8a..cc2179624e 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleKeywordPolicyViolations.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandleKeywordPolicyViolations.java @@ -158,7 +158,7 @@ private void runExample( errorCount = e.getGoogleAdsFailure().getErrorsCount(); } - // [START HandleKeywordPolicyViolations_1] + // [START handle_keyword_policy_violations_1] // Tries sending exemption requests for creating the keyword. However, if your keyword // contains many policy violations, but not all of them are exemptible, the request will not // be sent. @@ -178,7 +178,7 @@ private void runExample( + "policy violation exemptions.%n", response.getResults(0).getResourceName()); } else { - // [END HandleKeywordPolicyViolations_1] + // [END handle_keyword_policy_violations_1] System.out.println("No exemption request was sent because either:"); System.out.println("1) your keyword contained some non-exemptible policy violations, or"); System.out.println("2) other non-policy related errors were thrown"); @@ -192,7 +192,7 @@ private void runExample( * @param googleAdsException the exception to extract the keys from. * @return the list of extracted exemptible keys. */ - // [START HandleKeywordPolicyViolations] + // [START handle_keyword_policy_violations] private List extractExemptiblePolicyViolationKeys( GoogleAdsException googleAdsException) { List exemptibleKeys = new ArrayList<>(); @@ -220,5 +220,5 @@ private List extractExemptiblePolicyViolationKeys( } return exemptibleKeys; } - // [END HandleKeywordPolicyViolations] + // [END handle_keyword_policy_violations] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandlePartialFailure.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandlePartialFailure.java index 79de79c28b..ab482bcf00 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandlePartialFailure.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/errorhandling/HandlePartialFailure.java @@ -116,7 +116,7 @@ public void runExample(GoogleAdsClient googleAdsClient, long customerId, long ca * Attempts to create 3 ad groups with partial failure enabled. One of the ad groups will succeed, * while the other will fail. */ - // [START HandlePartialFailure] + // [START handle_partial_failure] private MutateAdGroupsResponse createAdGroups( GoogleAdsClient googleAdsClient, long customerId, long campaignId) { // This AdGroup should be created successfully - assuming the campaign in the params exists. @@ -154,17 +154,17 @@ private MutateAdGroupsResponse createAdGroups( .build()); } } - // [END HandlePartialFailure] + // [END handle_partial_failure] /** Inspects a response to check for presence of partial failure errors. */ - // [START HandlePartialFailure_1] + // [START handle_partial_failure_1] private boolean checkIfPartialFailureErrorExists(MutateAdGroupsResponse response) { return response.hasPartialFailureError(); } - // [END HandlePartialFailure_1] + // [END handle_partial_failure_1] /** Displays the result from the mutate operation. */ - // [START HandlePartialFailure_2] + // [START handle_partial_failure_2] private void printResults(MutateAdGroupsResponse response) throws InvalidProtocolBufferException { int operationIndex = 0; for (MutateAdGroupResult result : response.getResultsList()) { @@ -182,5 +182,5 @@ private void printResults(MutateAdGroupsResponse response) throws InvalidProtoco ++operationIndex; } } - // [END HandlePartialFailure_2] + // [END handle_partial_failure_2] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGeoTarget.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGeoTarget.java index 33489fd4bb..25f8887394 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGeoTarget.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGeoTarget.java @@ -52,7 +52,7 @@ private static class AddGeoTargetParams extends CodeSampleParams { private Long geoTargetConstantId = GEO_TARGET_CONSTANT_ID; } - // [START AddGeoTarget] + // [START add_geo_target] public static void main(String[] args) { AddGeoTargetParams params = new AddGeoTargetParams(); if (!params.parseArguments(args)) { @@ -97,7 +97,7 @@ public static void main(String[] args) { System.exit(1); } } - // [END AddGeoTarget] + // [END add_geo_target] /** * Runs the example. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGoogleMyBusinessLocationExtensions.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGoogleMyBusinessLocationExtensions.java index 384aefa37e..e94d1f0e5f 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGoogleMyBusinessLocationExtensions.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGoogleMyBusinessLocationExtensions.java @@ -161,7 +161,7 @@ private void runExample( placesLocationFeedData.setBusinessAccountId(businessAccountIdentifier); } - // [START AddGoogleMyBusinessLocationExtensions] + // [START add_google_my_business_location_extensions] // Creates a feed that will sync to the Google My Business account. Do not add FeedAttributes to // this object as Google Ads will add them automatically because this will be a system generated // feed. @@ -175,9 +175,9 @@ private void runExample( .setOrigin(FeedOrigin.GOOGLE); FeedOperation operation = FeedOperation.newBuilder().setCreate(gmbFeed).build(); - // [END AddGoogleMyBusinessLocationExtensions] + // [END add_google_my_business_location_extensions] - // [START AddGoogleMyBusinessLocationExtensions_1] + // [START add_google_my_business_location_extensions_1] try (FeedServiceClient feedServiceClient = googleAdsClient.getLatestVersion().createFeedServiceClient()) { // Adds the feed. Since it is a system generated feed, Google Ads will automatically: @@ -188,9 +188,9 @@ private void runExample( feedServiceClient.mutateFeeds(Long.toString(customerId), ImmutableList.of(operation)); String gmbFeedResourceName = response.getResults(0).getResourceName(); System.out.printf("GMB feed created with resource name: %s%n", gmbFeedResourceName); - // [END AddGoogleMyBusinessLocationExtensions_1] + // [END add_google_my_business_location_extensions_1] - // [START AddGoogleMyBusinessLocationExtensions_2] + // [START add_google_my_business_location_extensions_2] // Adds a CustomerFeed that associates the feed with this customer for // the LOCATION placeholder type. CustomerFeed customerFeed = @@ -212,9 +212,9 @@ private void runExample( CustomerFeedOperation customerFeedOperation = CustomerFeedOperation.newBuilder().setCreate(customerFeed).build(); - // [END AddGoogleMyBusinessLocationExtensions_2] + // [END add_google_my_business_location_extensions_2] - // [START AddGoogleMyBusinessLocationExtensions_3] + // [START add_google_my_business_location_extensions_3] try (CustomerFeedServiceClient customerFeedServiceClient = googleAdsClient.getLatestVersion().createCustomerFeedServiceClient()) { @@ -249,7 +249,7 @@ private void runExample( Thread.sleep(sleepSeconds * 1000); } } while (numberOfAttempts < MAX_CUSTOMER_FEED_ADD_ATTEMPTS && addedCustomerFeed == null); - // [END AddGoogleMyBusinessLocationExtensions_3] + // [END add_google_my_business_location_extensions_3] if (addedCustomerFeed == null) { throw new RuntimeException( diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddSitelinks.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddSitelinks.java index 0d9285154b..39f65d033e 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddSitelinks.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddSitelinks.java @@ -106,7 +106,7 @@ public static void main(String[] args) throws IOException { * @param campaignId the campaign ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddSitelinks] + // [START add_sitelinks] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long campaignId) { String campaignResourceName = ResourceNames.campaign(customerId, campaignId); @@ -139,7 +139,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long c } } } - // [END AddSitelinks] + // [END add_sitelinks] /** * Creates a list of ExtensionFeedItems. @@ -148,7 +148,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long c * @param customerId the client customer ID. * @param campaignResourceName the resource name of the campaign to target. */ - // [START AddSitelinks_1] + // [START add_sitelinks_1] private static List createExtensionFeedItems( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { SitelinkFeedItem sitelinkFeedItem1 = @@ -260,7 +260,7 @@ private static List createExtensionFeedItems( return resourceNames; } } - // [END AddSitelinks_1] + // [END add_sitelinks_1] /** * Creates a new SitelinkFeedItem with the specified attributes. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/RemoveEntireSitelinkCampaignExtensionSetting.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/RemoveEntireSitelinkCampaignExtensionSetting.java index 7911b9cc1d..7dd3abc169 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/RemoveEntireSitelinkCampaignExtensionSetting.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/RemoveEntireSitelinkCampaignExtensionSetting.java @@ -101,7 +101,7 @@ public static void main(String[] args) { } /** Runs the example. */ - // [START RemoveEntireSitelinkCampaignExtensionSetting] + // [START remove_entire_sitelink_campaign_extension_setting] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long campaignId) { // Retrieves all sitelink extension feed items for a customer and campaign. @@ -163,10 +163,10 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long c } } } - // [END RemoveEntireSitelinkCampaignExtensionSetting] + // [END remove_entire_sitelink_campaign_extension_setting] /** Retrieves all sitelink extension feed items for a customer + campaign combination. */ - // [START RemoveEntireSitelinkCampaignExtensionSetting_1] + // [START remove_entire_sitelink_campaign_extension_setting_1] private List getSitelinkExtensionFeedItems( GoogleAdsClient googleAdsClient, long customerId, long campaignId) { // Defines a query to retrieve the sitelink extension feed items. @@ -208,5 +208,5 @@ private List getSitelinkExtensionFeedItems( return result; } } - // [END RemoveEntireSitelinkCampaignExtensionSetting_1] + // [END remove_entire_sitelink_campaign_extension_setting_1] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelink.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelink.java index 339291dc6e..d544f3facb 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelink.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelink.java @@ -98,7 +98,7 @@ public static void main(String[] args) { * @param sitelinkText the new sitelink text to update to. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START UpdateSitelink] + // [START update_sitelink] private void runExample( GoogleAdsClient googleAdsClient, long customerId, long feedItemId, String sitelinkText) { try (ExtensionFeedItemServiceClient extensionFeedItemServiceClient = @@ -130,5 +130,5 @@ private void runExample( } } } - // [END UpdateSitelink] + // [END update_sitelink] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelinkCampaignExtensionSetting.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelinkCampaignExtensionSetting.java index 3f8d0b6319..b403d243a0 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelinkCampaignExtensionSetting.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/UpdateSitelinkCampaignExtensionSetting.java @@ -97,7 +97,7 @@ public static void main(String[] args) { } /** Runs the example. */ - // [START UpdateSitelinkCampaignExtensionSetting] + // [START update_sitelink_campaign_extension_setting] private void runExample( GoogleAdsClient googleAdsClient, long customerId, long campaignId, List feedItemIds) { // Converts the feed item IDs into resource names. @@ -136,5 +136,5 @@ private void runExample( "Updated a campaign extension setting with resource name: '%s'.%n", resourceName); } } - // [END UpdateSitelinkCampaignExtensionSetting] + // [END update_sitelink_campaign_extension_setting] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/RemoveFlightsFeedItemAttributeValue.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/RemoveFlightsFeedItemAttributeValue.java index eda5191485..780283ab0e 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/RemoveFlightsFeedItemAttributeValue.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/RemoveFlightsFeedItemAttributeValue.java @@ -141,7 +141,7 @@ private void runExample( * @param feedItemId ID of the feed item to be updated. * @param flightPlaceholderField the placeholder type for the attribute to be removed. */ - // [START RemoveFlightsFeedItemAttributeValue_1] + // [START remove_flights_feed_item_attribute_value_1] private void removeAttributeFromFeedItem( GoogleAdsClient googleAdsClient, long customerId, @@ -185,7 +185,7 @@ private void removeAttributeFromFeedItem( } } } - // [END RemoveFlightsFeedItemAttributeValue_1] + // [END remove_flights_feed_item_attribute_value_1] /** * Removes a feed item attribute value. @@ -196,7 +196,7 @@ private void removeAttributeFromFeedItem( * @param feedItemResourceName the resource name of the feedItem to be updated. * @param flightPlaceholderField the placeholder type for the attribute to be removed. */ - // [START RemoveFlightsFeedItemAttributeValue] + // [START remove_flights_feed_item_attribute_value] private FeedItem removeAttributeValueFromFeedItem( GoogleAdsClient googleAdsClient, long customerId, @@ -220,7 +220,7 @@ private FeedItem removeAttributeValueFromFeedItem( // be removed. return feedItem.toBuilder().removeAttributeValues(attributeIndex).build(); } - // [END RemoveFlightsFeedItemAttributeValue] + // [END remove_flights_feed_item_attribute_value] /** * Retrieves a feed item and its attribute values given a resource name. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/UpdateFlightsFeedItemStringAttributeValue.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/UpdateFlightsFeedItemStringAttributeValue.java index cddf064820..2a31686c02 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/UpdateFlightsFeedItemStringAttributeValue.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/feeds/UpdateFlightsFeedItemStringAttributeValue.java @@ -150,7 +150,7 @@ private void runExample( * @param flightPlaceholderField the placeholder type for the attribute to be removed. * @param attributeValue String value with which to update the FeedAttributeValue. */ - // [START UpdateFlightsFeedItemStringAttributeValue] + // [START update_flights_feed_item_string_attribute_value] private void updateFeedItem( GoogleAdsClient googleAdsClient, long customerId, @@ -213,7 +213,7 @@ private void updateFeedItem( } } } - // [END UpdateFlightsFeedItemStringAttributeValue] + // [END update_flights_feed_item_string_attribute_value] /** * Retrieves a feed item and its attribute values given a resource name. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelAd.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelAd.java index 6f0b087b8a..ec045509f7 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelAd.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelAd.java @@ -132,7 +132,7 @@ public static void main(String[] args) { * using the Percent CPC bidding strategy. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddHotelAd] + // [START add_hotel_ad] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -157,7 +157,7 @@ private void runExample( // Creates a hotel ad group ad. addHotelAdGroupAd(googleAdsClient, customerId, adGroupResourceName); } - // [END AddHotelAd] + // [END add_hotel_ad] /** * Creates a new campaign budget in the specified client account. @@ -216,7 +216,7 @@ private String addHotelCampaign( NetworkSettings networkSettings = NetworkSettings.newBuilder().setTargetGoogleSearch(true).build(); - // [START AddHotelAd_1] + // [START add_hotel_ad_1] // Creates the campaign. Campaign campaign = Campaign.newBuilder() @@ -238,7 +238,7 @@ private String addHotelCampaign( // Adds the networkSettings configured above. .setNetworkSettings(networkSettings) .build(); - // [END AddHotelAd_1] + // [END add_hotel_ad_1] // Creates a campaign operation. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); @@ -266,7 +266,7 @@ private String addHotelCampaign( * @return resource name of the newly created ad group. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddHotelAd_2] + // [START add_hotel_ad_2] private String addHotelAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates an ad group. @@ -296,7 +296,7 @@ private String addHotelAdGroup( return mutateAdGroupResult.getResourceName(); } } - // [END AddHotelAd_2] + // [END add_hotel_ad_2] /** * Creates a new hotel ad group ad in the specified ad group. @@ -308,7 +308,7 @@ private String addHotelAdGroup( * @return resource name of the newly created ad group ad. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddHotelAd_3] + // [START add_hotel_ad_3] private String addHotelAdGroupAd( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) { // Creates a new hotel ad. @@ -342,5 +342,5 @@ private String addHotelAdGroupAd( return mutateAdGroupAdResult.getResourceName(); } } - // [END AddHotelAd_3] + // [END add_hotel_ad_3] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelListingGroupTree.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelListingGroupTree.java index 97e8af4ef4..d51a5f1e80 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelListingGroupTree.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/hotelads/AddHotelListingGroupTree.java @@ -213,7 +213,7 @@ private static String addRootNode( * @return the "other hotel classes" node's resource name, which serves as a parent node for the * next level. */ - // [START addLevel1Nodes] + // [START add_level1_nodes] private static String addLevel1Nodes( long customerId, long adGroupId, @@ -264,7 +264,7 @@ private static String addLevel1Nodes( return otherHotelsAdGroupCriterion.getResourceName(); } - // [END addLevel1Nodes] + // [END add_level1_nodes] /** * Creates child nodes of level 2, partitioned by the country region. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/SetCustomClientTimeouts.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/SetCustomClientTimeouts.java index 0e98a8d0f5..8d75b867ce 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/SetCustomClientTimeouts.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/SetCustomClientTimeouts.java @@ -94,7 +94,7 @@ private void runExample(GoogleAdsClient googleAdsClient, Long customerId) { } /** Makes a server streaming call using a custom client timeout. */ - // [START SetCustomClientTimeouts] + // [START set_custom_client_timeouts] private void makeServerStreamingCall(GoogleAdsClient googleAdsClient, Long customerId) { StringBuilder output = new StringBuilder(); try (GoogleAdsServiceClient serviceClient = @@ -129,10 +129,10 @@ private void makeServerStreamingCall(GoogleAdsClient googleAdsClient, Long custo System.out.printf("All campaign IDs retrieved: %s.%n", output.toString()); } } - // [END SetCustomClientTimeouts] + // [END set_custom_client_timeouts] /** Makes an unary call using a custom client timeout. */ - // [START SetCustomClientTimeouts_1] + // [START set_custom_client_timeouts_1] private void makeUnaryCall(GoogleAdsClient googleAdsClient, Long customerId) { StringBuilder output = new StringBuilder(); try (GoogleAdsServiceClient serviceClient = @@ -165,5 +165,5 @@ private void makeUnaryCall(GoogleAdsClient googleAdsClient, Long customerId) { System.out.printf("All campaign IDs retrieved: %s.%n", output.toString()); } } - // [END SetCustomClientTimeouts_1] + // [END set_custom_client_timeouts_1] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/UploadImageAsset.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/UploadImageAsset.java index fabe4f5b8e..f69e740a97 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/UploadImageAsset.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/misc/UploadImageAsset.java @@ -90,7 +90,7 @@ public static void main(String[] args) throws IOException { * @param customerId the client customer ID. * @throws IOException if there are errors related to image processing. */ - // [START UploadImageAsset] + // [START upload_image_asset] private void runExample(GoogleAdsClient googleAdsClient, long customerId) throws IOException { byte[] imageData = ByteStreams.toByteArray(new URL(IMAGE_URL).openStream()); @@ -124,5 +124,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) throws response.getResults(0).getResourceName()); } } - // [END UploadImageAsset] + // [END upload_image_asset] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/AddKeywordPlan.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/AddKeywordPlan.java index 66790961c3..bf0d3a8e37 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/AddKeywordPlan.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/AddKeywordPlan.java @@ -112,7 +112,7 @@ public static void main(String[] args) { * @param googleAdsClient the Google Ads API client. * @param customerId the client customer ID. */ - // [START AddKeywordPlan] + // [START add_keyword_plan] private void runExample(GoogleAdsClient googleAdsClient, Long customerId) { String keywordPlanResource = createKeywordPlan(googleAdsClient, customerId); String planCampaignResource = @@ -312,5 +312,5 @@ private void createKeywordPlanCampaignKeywords( System.out.printf("Created negative keyword for keyword plan: %s%n", resourceName); } } - // [END AddKeywordPlan] + // [END add_keyword_plan] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateForecastMetrics.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateForecastMetrics.java index afc17f64f8..34f9532c71 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateForecastMetrics.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateForecastMetrics.java @@ -93,7 +93,7 @@ public static void main(String[] args) { * @param customerId the client customer ID. * @param planId the plan ID. */ - // [START GenerateForecastMetrics] + // [START generate_forecast_metrics] private void runExample(GoogleAdsClient googleAdsClient, Long customerId, Long planId) { String planResourceName = ResourceNames.keywordPlan(customerId, planId); @@ -110,5 +110,5 @@ private void runExample(GoogleAdsClient googleAdsClient, Long customerId, Long p } } } - // [END GenerateForecastMetrics] + // [END generate_forecast_metrics] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateKeywordIdeas.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateKeywordIdeas.java index 4448635c1f..c9df4393c2 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateKeywordIdeas.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GenerateKeywordIdeas.java @@ -134,7 +134,7 @@ public static void main(String[] args) throws IOException { * @throws IllegalArgumentException if {@code keywords} is empty and {@code pageUrl} is null. * @throws Exception if the example failed due to other errors. */ - // [START GenerateKeywordIdeas] + // [START generate_keyword_ideas] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -189,5 +189,5 @@ private void runExample( } } } - // [END GenerateKeywordIdeas] + // [END generate_keyword_ideas] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GetAdGroupCriterionCpcBidSimulations.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GetAdGroupCriterionCpcBidSimulations.java index bc726a9719..f6df50f3d9 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GetAdGroupCriterionCpcBidSimulations.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/planning/GetAdGroupCriterionCpcBidSimulations.java @@ -95,7 +95,7 @@ public static void main(String[] args) { * @param adGroupId the ad group ID to get the ad group criterion CPC bid simulations for. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START GetAdGroupCriterionCpcBidSimulations] + // [START get_ad_group_criterion_cpc_bid_simulations] private void runExample(GoogleAdsClient googleAdsClient, long customerId, long adGroupId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { @@ -149,5 +149,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a } } } - // [END GetAdGroupCriterionCpcBidSimulations] + // [END get_ad_group_criterion_cpc_bid_simulations] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/ApplyRecommendation.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/ApplyRecommendation.java index 5e64793a0d..0977ba93bc 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/ApplyRecommendation.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/ApplyRecommendation.java @@ -99,7 +99,7 @@ public static void main(String[] args) throws IOException { * @param recommendationId the recommendation ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START ApplyRecommendation] + // [START apply_recommendation] private void runExample( GoogleAdsClient googleAdsClient, long customerId, String recommendationId) { String recommendationResourceName = ResourceNames.recommendation(customerId, recommendationId); @@ -130,5 +130,5 @@ private void runExample( } } } - // [END ApplyRecommendation] + // [END apply_recommendation] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/GetTextAdRecommendations.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/GetTextAdRecommendations.java index 188e93149c..dd892e8ca3 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/GetTextAdRecommendations.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/recommendations/GetTextAdRecommendations.java @@ -87,7 +87,7 @@ public static void main(String[] args) throws IOException { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START GetTextAdRecommendations] + // [START get_text_ad_recommendations] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { @@ -136,5 +136,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END GetTextAdRecommendations] + // [END get_text_ad_recommendations] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCombinedRuleUserList.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCombinedRuleUserList.java index 1ff94f80a0..4f05024d56 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCombinedRuleUserList.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCombinedRuleUserList.java @@ -98,7 +98,7 @@ public static void main(String[] args) { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddCombinedRuleUserList] + // [START add_combined_rule_user_list] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { String urlString = "url__"; @@ -189,5 +189,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { System.out.printf("Created user list with resource name '%s'.%n", userListResourceName); } } - // [END AddCombinedRuleUserList] + // [END add_combined_rule_user_list] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionAction.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionAction.java index 98071143ba..684719ed09 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionAction.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionAction.java @@ -90,7 +90,7 @@ public static void main(String[] args) { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddConversionAction] + // [START add_conversion_action] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a ConversionAction. @@ -124,5 +124,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END AddConversionAction] + // [END add_conversion_action] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionBasedUserList.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionBasedUserList.java index 3246c766c1..a2655d37ac 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionBasedUserList.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddConversionBasedUserList.java @@ -100,7 +100,7 @@ public static void main(String[] args) { * @param conversionActionIds the IDs of the conversion actions for the basic user list. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddConversionBasedUserList] + // [START add_conversion_based_user_list] private void runExample( GoogleAdsClient googleAdsClient, long customerId, List conversionActionIds) { List userListActionInfoList = new ArrayList<>(); @@ -144,5 +144,5 @@ private void runExample( response.getResults(0).getResourceName()); } } - // [END AddConversionBasedUserList] + // [END add_conversion_based_user_list] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCustomerMatchUserList.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCustomerMatchUserList.java index 614c0b37dc..959b7cad06 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCustomerMatchUserList.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddCustomerMatchUserList.java @@ -182,7 +182,7 @@ private String createCustomerMatchUserList(GoogleAdsClient googleAdsClient, long * @param userListResourceName the resource name of the Customer Match user list to add members. * to. */ - // [START AddCustomerMatchUserList] + // [START add_customer_match_user_list] private void addUsersToCustomerMatchUserList( GoogleAdsClient googleAdsClient, long customerId, String userListResourceName) throws UnsupportedEncodingException { @@ -244,7 +244,7 @@ private void addUsersToCustomerMatchUserList( googleAdsClient, customerId, offlineUserDataJobResourceName, userListResourceName); } } - // [END AddCustomerMatchUserList] + // [END add_customer_match_user_list] /** * Creates a list of offline user data job operations that will add users to the list. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddExpressionRuleUserList.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddExpressionRuleUserList.java index cba839e3fe..1a35e8e797 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddExpressionRuleUserList.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddExpressionRuleUserList.java @@ -97,7 +97,7 @@ public static void main(String[] args) { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddExpressionRuleUserList] + // [START add_expression_rule_user_list] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { String urlString = "url__"; @@ -179,5 +179,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { System.out.printf("Created user list with resource name '%s'.%n", userListResourceName); } } - // [END AddExpressionRuleUserList] + // [END add_expression_rule_user_list] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddLogicalUserList.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddLogicalUserList.java index 876992159e..bdc3e7c0aa 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddLogicalUserList.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddLogicalUserList.java @@ -104,7 +104,7 @@ public static void main(String[] args) { * @param userListIds the IDs of the lists to be used for the new combination user list. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddLogicalUserList] + // [START add_logical_user_list] private void runExample( GoogleAdsClient googleAdsClient, long customerId, List userListIds) { // Adds each of the provided list IDs to a list of rule operands specifying which lists the @@ -152,5 +152,5 @@ private void runExample( response.getResults(0).getResourceName()); } } - // [END AddLogicalUserList] + // [END add_logical_user_list] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddMerchantCenterDynamicRemarketingCampaign.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddMerchantCenterDynamicRemarketingCampaign.java index b2fadfebe5..955027bc1d 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddMerchantCenterDynamicRemarketingCampaign.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddMerchantCenterDynamicRemarketingCampaign.java @@ -161,7 +161,7 @@ private void runExample( * @param campaignBudgetId the campaign budget ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddMerchantCenterDynamicRemarketingCampaign] + // [START add_merchant_center_dynamic_remarketing_campaign] private String createCampaign( GoogleAdsClient googleAdsClient, long customerId, @@ -208,7 +208,7 @@ private String createCampaign( return campaignResourceName; } } - // [END AddMerchantCenterDynamicRemarketingCampaign] + // [END add_merchant_center_dynamic_remarketing_campaign] /** * Creates an ad group for the remarketing campaign. @@ -218,7 +218,7 @@ private String createCampaign( * @param campaignResourceName the campaign resource name. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddMerchantCenterDynamicRemarketingCampaign_1] + // [START add_merchant_center_dynamic_remarketing_campaign_1] private String createAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates the ad group. @@ -244,7 +244,7 @@ private String createAdGroup( return adGroupResourceName; } } - // [END AddMerchantCenterDynamicRemarketingCampaign_1] + // [END add_merchant_center_dynamic_remarketing_campaign_1] /** * Creates the responsive display ad. @@ -254,7 +254,7 @@ private String createAdGroup( * @param adGroupResourceName the campaign resource name. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddMerchantCenterDynamicRemarketingCampaign_2] + // [START add_merchant_center_dynamic_remarketing_campaign_2] private void createAd( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) throws IOException { @@ -329,7 +329,7 @@ private void createAd( response.getResults(0).getResourceName()); } } - // [END AddMerchantCenterDynamicRemarketingCampaign_2] + // [END add_merchant_center_dynamic_remarketing_campaign_2] /** * Adds an image to the Google Ads account. @@ -377,7 +377,7 @@ private String uploadAsset( * @param userListId ID of the user list. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddMerchantCenterDynamicRemarketingCampaign_3] + // [START add_merchant_center_dynamic_remarketing_campaign_3] private void attachUserList( GoogleAdsClient googleAdsClient, long customerId, @@ -407,5 +407,5 @@ private void attachUserList( response.getResults(0).getResourceName()); } } - // [END AddMerchantCenterDynamicRemarketingCampaign_3] + // [END add_merchant_center_dynamic_remarketing_campaign_3] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRealEstateFeed.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRealEstateFeed.java index a118fc5aa9..ec0565deca 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRealEstateFeed.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRealEstateFeed.java @@ -199,7 +199,7 @@ private String createFeed(GoogleAdsClient googleAdsClient, long customerId) { * @param feedResourceName the resource name of the feed. * @return a Map containing the RealEstatePlaceholderField and FeedAttribute. */ - // [START AddRealEstateFeed] + // [START add_real_estate_feed] private Map getFeed( GoogleAdsClient googleAdsClient, long customerId, String feedResourceName) { // Constructs the query. @@ -251,7 +251,7 @@ private Map getFeed( return feedAttributes; } } - // [END AddRealEstateFeed] + // [END add_real_estate_feed] /** * Creates a feed mapping for a given feed. @@ -341,7 +341,7 @@ private void createFeedMapping( * @param feedAttributes the feed attributes. * @param feedResourceName the feed resource name. */ - // [START AddRealEstateFeed_1] + // [START add_real_estate_feed_1] private void createFeedItems( GoogleAdsClient googleAdsClient, long customerId, @@ -412,5 +412,5 @@ private void createFeedItems( } } } - // [END AddRealEstateFeed_1] + // [END add_real_estate_feed_1] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRemarketingAction.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRemarketingAction.java index a14079cd77..d02b5d4622 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRemarketingAction.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/AddRemarketingAction.java @@ -89,7 +89,7 @@ public static void main(String[] args) { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddRemarketingAction] + // [START add_remarketing_action] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a remarketing action with the specified name. @@ -116,7 +116,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a query that retrieves the previously created remarketing action with its generated // tag snippets. - // [START AddRemarketingAction_1] + // [START add_remarketing_action_1] String query = String.format( "SELECT remarketing_action.id," @@ -125,7 +125,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { + "FROM remarketing_action " + "WHERE remarketing_action.resource_name = '%s'", remarketingActionResourceName); - // [END AddRemarketingAction_1] + // [END add_remarketing_action_1] try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { // Issues a search request. @@ -152,5 +152,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END AddRemarketingAction] + // [END add_remarketing_action] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupAdvancedRemarketing.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupAdvancedRemarketing.java index 0bb425f21a..d21db0cf7d 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupAdvancedRemarketing.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupAdvancedRemarketing.java @@ -103,7 +103,7 @@ public static void main(String[] args) { */ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a rule targeting any user that visited the checkout page. - // [START SetupAdvancedRemarketing] + // [START setup_advanced_remarketing] UserListRuleItemInfo checkoutRule = UserListRuleItemInfo.newBuilder() // The rule variable name must match a corresponding key name fired from a pixel. @@ -118,10 +118,10 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setValue("checkout") .build()) .build(); - // [END SetupAdvancedRemarketing] + // [END setup_advanced_remarketing] // Creates a rule targeting any user that had more than one item in their cart. - // [START SetupAdvancedRemarketing_1] + // [START setup_advanced_remarketing_1] UserListRuleItemInfo cartSizeRule = UserListRuleItemInfo.newBuilder() // The rule variable name must match a corresponding key name fired from a pixel. @@ -132,22 +132,22 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setValue(1.0) .build()) .build(); - // [END SetupAdvancedRemarketing_1] + // [END setup_advanced_remarketing_1] // Creates a rule group that includes the checkout and cart size rules. Combining the two rule // items into a UserListRuleItemGroupInfo object causes Google Ads to AND their rules together. // To instead OR the rules together, each rule should be placed in its own rule item group. - // [START SetupAdvancedRemarketing_2] + // [START setup_advanced_remarketing_2] UserListRuleItemGroupInfo checkoutAndCartSizeRuleGroup = UserListRuleItemGroupInfo.newBuilder() .addAllRuleItems(ImmutableList.of(checkoutRule, cartSizeRule)) .build(); - // [END SetupAdvancedRemarketing_2] + // [END setup_advanced_remarketing_2] // Creates the RuleItem for checkout start date. // The tags and keys used below must have been in place in the past for the date range specified // in the rules. - // [START SetupAdvancedRemarketing_3] + // [START setup_advanced_remarketing_3] UserListRuleItemInfo startDateRule = UserListRuleItemInfo.newBuilder() // The rule variable name must match a corresponding key name fired from a pixel. @@ -160,10 +160,10 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setValue("20191031") .build()) .build(); - // [END SetupAdvancedRemarketing_3] + // [END setup_advanced_remarketing_3] // Creates the RuleItem for checkout end date. - // [START SetupAdvancedRemarketing_4] + // [START setup_advanced_remarketing_4] UserListRuleItemInfo endDateRule = UserListRuleItemInfo.newBuilder() // The rule variable name must match a corresponding key name fired from a pixel. @@ -174,24 +174,24 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .setValue("20200101") .build()) .build(); - // [END SetupAdvancedRemarketing_4] + // [END setup_advanced_remarketing_4] // Creates a rule group targeting users who checked out between November and December by using // the start and end date rules. Combining the two rule items into a UserListRuleItemGroupInfo // object causes Google Ads to AND their rules together. To instead OR the rules together, each // rule should be placed in its own rule item group. - // [START SetupAdvancedRemarketing_5] + // [START setup_advanced_remarketing_5] UserListRuleItemGroupInfo checkoutDateRuleGroup = UserListRuleItemGroupInfo.newBuilder() .addAllRuleItems(ImmutableList.of(startDateRule, endDateRule)) .build(); - // [END SetupAdvancedRemarketing_5] + // [END setup_advanced_remarketing_5] // Creates an ExpressionRuleUserListInfo object, or a boolean rule that defines this user list. // The default rule_type for a UserListRuleInfo object is OR of ANDs (disjunctive normal form). // That is, rule items will be ANDed together within rule item groups and the groups themselves // will be ORed together. - // [START SetupAdvancedRemarketing_6] + // [START setup_advanced_remarketing_6] ExpressionRuleUserListInfo expressionRuleUserListInfo = ExpressionRuleUserListInfo.newBuilder() .setRule( @@ -199,7 +199,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { .addAllRuleItemGroups( ImmutableList.of(checkoutAndCartSizeRuleGroup, checkoutDateRuleGroup))) .build(); - // [END SetupAdvancedRemarketing_6] + // [END setup_advanced_remarketing_6] // Defines a representation of a user list that is generated by a rule. RuleBasedUserListInfo ruleBasedUserListInfo = diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupRemarketing.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupRemarketing.java index 8b9d48143f..e8e3f1e771 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupRemarketing.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/SetupRemarketing.java @@ -167,7 +167,7 @@ private void runExample( * @param customerId the client customer ID. * @return the user list resource name. */ - // [START SetupRemarketing] + // [START setup_remarketing] private String createUserList(GoogleAdsClient googleAdsClient, long customerId) { // Creates a rule targeting any user that visited a url containing 'example.com'. UserListRuleItemInfo rule = @@ -226,7 +226,7 @@ private String createUserList(GoogleAdsClient googleAdsClient, long customerId) return userListResourceName; } } - // [END SetupRemarketing] + // [END setup_remarketing] /** * Creates an ad group criterion that targets a user list with an ad group. @@ -237,7 +237,7 @@ private String createUserList(GoogleAdsClient googleAdsClient, long customerId) * @param userList the resource name of the user list to be targeted. * @return the ad group criterion resource name. */ - // [START SetupRemarketing_1] + // [START setup_remarketing_1] private String targetAdsInAdGroupToUserList( GoogleAdsClient googleAdsClient, long customerId, long adGroupId, String userList) { // Creates the ad group criterion targeting members of the user list. @@ -267,7 +267,7 @@ private String targetAdsInAdGroupToUserList( return adGroupCriterionResourceName; } } - // [END SetupRemarketing_1] + // [END setup_remarketing_1] /** * Updates the bid modifier value on an ad group criterion. @@ -319,7 +319,7 @@ private void modifyAdGroupBids( * @param customerId the client customer ID. * @param campaignId the campaign under which to remove the ad group criteria. */ - // [START SetupRemarketing_3] + // [START setup_remarketing_3] private void removeExistingListCriteriaFromAdGroup( GoogleAdsClient googleAdsClient, long customerId, long campaignId) { // Retrieves all of the ad group criteria under a campaign. @@ -349,7 +349,7 @@ private void removeExistingListCriteriaFromAdGroup( } } } - // [END SetupRemarketing_3] + // [END setup_remarketing_3] /** * Finds all of user list ad group criteria under a campaign. @@ -359,7 +359,7 @@ private void removeExistingListCriteriaFromAdGroup( * @param campaignId the campaign under which to search the ad group criteria. * @return a list of the ad group criteria resource names. */ - // [START SetupRemarketing_2] + // [START setup_remarketing_2] private List getUserListAdGroupCriterion( GoogleAdsClient googleAdsClient, long customerId, long campaignId) { List userListCriteria = new ArrayList<>(); @@ -392,7 +392,7 @@ private List getUserListAdGroupCriterion( } return userListCriteria; } - // [END SetupRemarketing_2] + // [END setup_remarketing_2] /** * Creates a campaign criterion that targets a user list with a campaign. @@ -403,7 +403,7 @@ private List getUserListAdGroupCriterion( * @param userList the resource name of the user list to be targeted. * @return the campaign criterion resource name. */ - // [START SetupRemarketing_4] + // [START setup_remarketing_4] private String targetAdsInCampaignToUserList( GoogleAdsClient googleAdsClient, long customerId, long campaignId, String userList) { // Creates the campaign criterion. @@ -433,7 +433,7 @@ private String targetAdsInCampaignToUserList( return campaignCriterionResourceName; } } - // [END SetupRemarketing_4] + // [END setup_remarketing_4] /** * Updates the bid modifier value on a campaign criterion. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UpdateAudienceTargetRestriction.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UpdateAudienceTargetRestriction.java index 5c9539ebd2..02f8bd2d5d 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UpdateAudienceTargetRestriction.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UpdateAudienceTargetRestriction.java @@ -109,13 +109,13 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { // Creates a search request that retrieves the targeting settings from a given ad group. - // [START UpdateAudienceTargetRestriction] + // [START update_audience_target_restriction] String searchQuery = "SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions " + "FROM ad_group " + "WHERE ad_group.id = " + adGroupId; - // [END UpdateAudienceTargetRestriction] + // [END update_audience_target_restriction] // Creates a request that will retrieve all ad groups using pages of the specified page size. SearchGoogleAdsRequest request = @@ -144,7 +144,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a // Reconstructs the TargetingSetting object with the updated audience target restriction // because Google will overwrite the entire targeting_setting field of the ad group when // the field mask includes targeting_setting in an update operation. - // [START UpdateAudienceTargetRestriction_1] + // [START update_audience_target_restriction_1] for (TargetRestriction targetRestriction : targetRestrictions) { TargetingDimension targetingDimension = targetRestriction.getTargetingDimension(); boolean bidOnly = targetRestriction.getBidOnly(); @@ -167,7 +167,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a .setBidOnly(true)); } } - // [END UpdateAudienceTargetRestriction_1] + // [END update_audience_target_restriction_1] } // Only updates the TargetingSetting on the ad group if there is an AUDIENCE TargetRestriction // with bid_only set to false. @@ -188,7 +188,7 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId, long a * @param adGroupId the ID of the ad group to update. * @param targetingSetting the updated targeting setting. */ - // [START UpdateAudienceTargetRestriction_2] + // [START update_audience_target_restriction_2] private void updateTargetingSetting( GoogleAdsClient googleAdsClient, long customerId, @@ -222,5 +222,5 @@ private void updateTargetingSetting( response.getResults(0).getResourceName()); } } - // [END UpdateAudienceTargetRestriction_2] + // [END update_audience_target_restriction_2] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadCallConversion.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadCallConversion.java index 4f081de2ce..21e37ecbe5 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadCallConversion.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadCallConversion.java @@ -121,7 +121,7 @@ public static void main(String[] args) { * @param callStartDateTime the call start date time * @param conversionValue the value of the conversion in USD. */ - // [START UploadCallConversion] + // [START upload_call_conversion] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -166,5 +166,5 @@ private void runExample( result.getCallStartDateTime(), result.getCallerId(), result.getConversionAction()); } } - // [END UploadCallConversion] + // [END upload_call_conversion] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadConversionAdjustment.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadConversionAdjustment.java index 6224259d7c..40ead46dcb 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadConversionAdjustment.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadConversionAdjustment.java @@ -150,7 +150,7 @@ public static void main(String[] args) { * @param adjustmentDateTime date and time of the adjustment. * @param restatementValue the adjusted value for adjustment type RESTATEMENT. */ - // [START UploadConversionAdjustment] + // [START upload_conversion_adjustment] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -214,5 +214,5 @@ private void runExample( } } } - // [END UploadConversionAdjustment] + // [END upload_conversion_adjustment] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadOfflineConversion.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadOfflineConversion.java index 549b0ba8d6..f2e951ea29 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadOfflineConversion.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadOfflineConversion.java @@ -115,7 +115,7 @@ public static void main(String[] args) { * @param conversionDateTime date and time of the conversion. * @param conversionValue the value of the conversion. */ - // [START UploadOfflineConversion] + // [START upload_offline_conversion] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -166,5 +166,5 @@ private void runExample( } } } - // [END UploadOfflineConversion] + // [END upload_offline_conversion] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/reporting/GetKeywordStats.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/reporting/GetKeywordStats.java index c62b8a82bc..5a3d3257a3 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/reporting/GetKeywordStats.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/reporting/GetKeywordStats.java @@ -90,7 +90,7 @@ public static void main(String[] args) throws IOException { * @param customerId the client customer ID. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START GetKeywordStats] + // [START get_keyword_stats] private void runExample(GoogleAdsClient googleAdsClient, long customerId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { @@ -160,5 +160,5 @@ private void runExample(GoogleAdsClient googleAdsClient, long customerId) { } } } - // [END GetKeywordStats] + // [END get_keyword_stats] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductAd.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductAd.java index f971dbf64c..87e3244115 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductAd.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductAd.java @@ -207,7 +207,7 @@ private String addCampaignBudget(GoogleAdsClient googleAdsClient, long customerI * @return resource name of the newly created campaign. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingProductAd_2] + // [START add_shopping_product_ad_2] private String addStandardShoppingCampaign( GoogleAdsClient googleAdsClient, long customerId, @@ -264,7 +264,7 @@ private String addStandardShoppingCampaign( return result.getResourceName(); } } - // [END AddShoppingProductAd_2] + // [END add_shopping_product_ad_2] /** * Creates a new shopping product ad group in the specified campaign. @@ -276,7 +276,7 @@ private String addStandardShoppingCampaign( * @return resource name of the newly created ad group. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingProductAd_1] + // [START add_shopping_product_ad_1] private String addShoppingProductAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates an ad group. @@ -307,7 +307,7 @@ private String addShoppingProductAdGroup( return mutateAdGroupResult.getResourceName(); } } - // [END AddShoppingProductAd_1] + // [END add_shopping_product_ad_1] /** * Creates a new shopping product ad group ad in the specified ad group. @@ -319,7 +319,7 @@ private String addShoppingProductAdGroup( * @return resource name of the newly created ad group ad. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingProductAd] + // [START add_shopping_product_ad] private String addShoppingProductAdGroupAd( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) { // Creates a new shopping product ad. @@ -351,7 +351,7 @@ private String addShoppingProductAdGroupAd( return mutateAdGroupAdResult.getResourceName(); } } - // [END AddShoppingProductAd] + // [END add_shopping_product_ad] /** * Creates a new default shopping listing group for the specified ad group. A listing group is the diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductListingGroupTree.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductListingGroupTree.java index 283fcb7567..93a31e7390 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductListingGroupTree.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingProductListingGroupTree.java @@ -128,7 +128,7 @@ public static void main(String[] args) { * group tree already exists and this option is not set to true. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingProductListingGroupTree] + // [START add_shopping_product_listing_group_tree] private void runExample( GoogleAdsClient googleAdsClient, long customerId, @@ -270,7 +270,7 @@ private void runExample( } } } - // [END AddShoppingProductListingGroupTree] + // [END add_shopping_product_listing_group_tree] /** * Removes all the ad group criteria that define the existing listing group tree for an ad group. diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingSmartAd.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingSmartAd.java index af9cab5408..9791618f05 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingSmartAd.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/shoppingads/AddShoppingSmartAd.java @@ -213,7 +213,7 @@ private String addCampaignBudget(GoogleAdsClient googleAdsClient, long customerI * @return resource name of the newly created campaign. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingSmartAd_3] + // [START add_shopping_smart_ad_3] private String addSmartShoppingCampaign( GoogleAdsClient googleAdsClient, long customerId, @@ -230,7 +230,7 @@ private String addSmartShoppingCampaign( .setMerchantId(merchantCenterAccountId) .build(); - // [START AddShoppingSmartAd] + // [START add_shopping_smart_ad] // Creates the campaign. Campaign campaign = Campaign.newBuilder() @@ -259,7 +259,7 @@ private String addSmartShoppingCampaign( // Sets the budget. .setCampaignBudget(budgetResourceName) .build(); - // [END AddShoppingSmartAd] + // [END add_shopping_smart_ad] // Creates a campaign operation. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); @@ -276,7 +276,7 @@ private String addSmartShoppingCampaign( return result.getResourceName(); } } - // [END AddShoppingSmartAd_3] + // [END add_shopping_smart_ad_3] /** * Creates a new ad group in the specified Smart Shopping campaign. @@ -288,7 +288,7 @@ private String addSmartShoppingCampaign( * @return resource name of the newly created ad group. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingSmartAd_2] + // [START add_shopping_smart_ad_2] private String addSmartShoppingAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates an ad group. @@ -317,7 +317,7 @@ private String addSmartShoppingAdGroup( return mutateAdGroupResult.getResourceName(); } } - // [END AddShoppingSmartAd_2] + // [END add_shopping_smart_ad_2] /** * Creates a new ad group ad in the specified Smart Shopping ad group. @@ -329,7 +329,7 @@ private String addSmartShoppingAdGroup( * @return resource name of the newly created ad group ad. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START AddShoppingSmartAd_1] + // [START add_shopping_smart_ad_1] private String addSmartShoppingAdGroupAd( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) { // Creates a new Smart Shopping ad. @@ -359,7 +359,7 @@ private String addSmartShoppingAdGroupAd( return mutateAdGroupAdResult.getResourceName(); } } - // [END AddShoppingSmartAd_1] + // [END add_shopping_smart_ad_1] /** * Creates a new Shopping listing group for the specified ad group. This is known as a "product diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/AddCampaignTargetingCriteria.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/AddCampaignTargetingCriteria.java index bb3bcaf339..fdaf92e0b2 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/AddCampaignTargetingCriteria.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/AddCampaignTargetingCriteria.java @@ -183,7 +183,7 @@ private static CampaignCriterion buildNegativeKeywordCriterion( * @param campaignResourceName the campaign resource name to target. * @return a campaign criterion object with the specified locationId and resource name. */ - // [START AddCampaignTargetingCriteria] + // [START add_campaign_targeting_criteria] private static CampaignCriterion buildLocationIdCriterion( long locationId, String campaignResourceName) { Builder criterionBuilder = CampaignCriterion.newBuilder().setCampaign(campaignResourceName); @@ -194,7 +194,7 @@ private static CampaignCriterion buildLocationIdCriterion( return criterionBuilder.build(); } - // [END AddCampaignTargetingCriteria] + // [END add_campaign_targeting_criteria] /** * Creates a campaign criterion from an address and proximity radius. @@ -202,7 +202,7 @@ private static CampaignCriterion buildLocationIdCriterion( * @param campaignResourceName the campaign resource name to target. * @return a campaign criterion object with the specified address and targeting radius. */ - // [START AddCampaignTargetingCriteria_1] + // [START add_campaign_targeting_criteria_1] private static CampaignCriterion buildProximityLocation(String campaignResourceName) { Builder builder = CampaignCriterion.newBuilder().setCampaign(campaignResourceName); @@ -218,5 +218,5 @@ private static CampaignCriterion buildProximityLocation(String campaignResourceN return builder.build(); } - // [END AddCampaignTargetingCriteria_1] + // [END add_campaign_targeting_criteria_1] } diff --git a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/GetGeoTargetConstantsByNames.java b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/GetGeoTargetConstantsByNames.java index 7a5e7da5f8..2154060224 100644 --- a/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/GetGeoTargetConstantsByNames.java +++ b/google-ads-examples/src/main/java/com/google/ads/googleads/examples/targeting/GetGeoTargetConstantsByNames.java @@ -65,7 +65,7 @@ public static void main(String[] args) { * @param googleAdsClient the Google Ads API client. * @throws GoogleAdsException if an API request failed with one or more service errors. */ - // [START GetGeoTargetConstantsByNames] + // [START get_geo_target_constants_by_names] private void runExample(GoogleAdsClient googleAdsClient) { try (GeoTargetConstantServiceClient geoTargetClient = googleAdsClient.getLatestVersion().createGeoTargetConstantServiceClient()) { @@ -102,5 +102,5 @@ private void runExample(GoogleAdsClient googleAdsClient) { } } } - // [END GetGeoTargetConstantsByNames] + // [END get_geo_target_constants_by_names] }