Skip to content

Commit 83b3bb4

Browse files
authored
Update all references of Google My Business to Business Profile (#521)
Change-Id: Ia8c7b2207aa2b411cc2cf2f7dced0be724625238
1 parent 66d1106 commit 83b3bb4

5 files changed

Lines changed: 57 additions & 52 deletions

File tree

google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddLocalCampaign.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* Adds an Local campaign.
7373
*
7474
* <p>Prerequisite: To create a Local campaign, you need to define the store locations you want to
75-
* promote by linking your Google My Business account or selecting affiliate locations. More
75+
* promote by linking your Business Profile account or selecting affiliate locations. More
7676
* information about Local campaigns can be found at:
7777
* https://support.google.com/google-ads/answer/9118422.
7878
*/
@@ -208,7 +208,7 @@ private String createLocalCampaign(
208208
// Configures the Local campaign setting.
209209
.setLocalCampaignSetting(
210210
LocalCampaignSetting.newBuilder()
211-
// Use the locations associated with the customer's linked Google My Business
211+
// Use the locations associated with the customer's linked Business Profile
212212
// account.
213213
.setLocationSourceType(LocationSourceType.GOOGLE_MY_BUSINESS))
214214
.setOptimizationGoalSetting(

google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/AddSmartCampaign.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ private static class AddSmartCampaignParams extends CodeSampleParams {
112112
@Parameter(
113113
names = ArgumentNames.BUSINESS_LOCATION_ID,
114114
description =
115-
"The ID of a Google My Business (GMB) location. This is required if a business name is"
116-
+ " not provided. It can be retrieved using the GMB API, for details see:"
115+
"The ID of a Business Profile location. This is required if a business name is not"
116+
+ " provided. It can be retrieved using the Business Profile API, for details see:"
117117
+ " https://developers.google.com/my-business/reference/rest/v4/accounts.locations")
118118
private String locationId;
119119

120120
@Parameter(
121121
names = ArgumentNames.BUSINESS_NAME,
122122
description =
123-
"The name of a Google My Business (GMB) business. This is required if a business"
123+
"The name of a Business Profile business. This is required if a business"
124124
+ " location ID is not provided.")
125125
private String businessName;
126126
}

google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddAffiliateLocationExtensions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ private void removeLocationExtensionFeeds(GoogleAdsClient googleAdsClient, long
187187
// Removes a location extension feed. Does this with the following steps:
188188
// 1. Retrieves the existing CustomerFeed links.
189189
// 2. Removes the CustomerFeed so that the location extensions from the feed stop serving.
190-
// 3. Removes the feed so that Google Ads will no longer sync from the GMB account.
190+
// 3. Removes the feed so that Google Ads will no longer sync from the Business Profile
191+
// account.
191192
List<CustomerFeed> oldCustomerFeeds =
192193
getLocationExtensionCustomerFeeds(googleAdsClient, customerId);
193194
if (oldCustomerFeeds.isEmpty()) {

google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddGoogleMyBusinessLocationExtensions.java renamed to google-ads-examples/src/main/java/com/google/ads/googleads/examples/extensions/AddBusinessProfileLocationExtensions.java

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -43,43 +43,43 @@
4343
import java.io.IOException;
4444

4545
/**
46-
* Adds a feed that syncs feed items from a Google My Business (GMB) account and associates the feed
47-
* with a customer.
46+
* Adds a feed that syncs feed items from a Business Profile account and associates the feed with a
47+
* customer.
4848
*/
49-
public class AddGoogleMyBusinessLocationExtensions {
49+
public class AddBusinessProfileLocationExtensions {
5050
// The required scope for setting the OAuth info.
5151
private final String GOOGLE_ADS_SCOPE = "https://www.googleapis.com/auth/adwords";
5252

5353
// The maximum number of CustomerFeed ADD operation attempts to make before throwing an exception.
5454
private static final int MAX_CUSTOMER_FEED_ADD_ATTEMPTS = 10;
5555

56-
private static class AddGoogleMyBusinessLocationExtensionsParams extends CodeSampleParams {
56+
private static class AddBusinessProfileLocationExtensionsParams extends CodeSampleParams {
5757

5858
@Parameter(names = ArgumentNames.CUSTOMER_ID, required = true)
5959
private Long customerId;
6060

61-
@Parameter(names = ArgumentNames.GMB_EMAIL_ADDRESS, required = true)
62-
private String gmbEmailAddress;
61+
@Parameter(names = ArgumentNames.BUSINESS_PROFILE_EMAIL_ADDRESS, required = true)
62+
private String businessProfileEmailAddress;
6363

6464
@Parameter(names = ArgumentNames.BUSINESS_ACCOUNT_IDENTIFIER)
6565
private String businessAccountIdentifier;
6666

67-
@Parameter(names = ArgumentNames.GMB_ACCESS_TOKEN, required = true)
68-
private String gmbAccessToken;
67+
@Parameter(names = ArgumentNames.BUSINESS_PROFILE_ACCESS_TOKEN, required = true)
68+
private String businessProfileAccessToken;
6969
}
7070

7171
public static void main(String[] args) throws InterruptedException, IOException {
72-
AddGoogleMyBusinessLocationExtensionsParams params =
73-
new AddGoogleMyBusinessLocationExtensionsParams();
72+
AddBusinessProfileLocationExtensionsParams params =
73+
new AddBusinessProfileLocationExtensionsParams();
7474

7575
if (!params.parseArguments(args)) {
7676

7777
// Either pass the required parameters for this example on the command line, or insert them
7878
// into the code here. See the parameter class definition above for descriptions.
7979
params.customerId = Long.parseLong("INSERT_CUSTOMER_ID_HERE");
80-
params.gmbEmailAddress = "INSERT_GMB_EMAIL_ADDRESS_HERE";
80+
params.businessProfileEmailAddress = "INSERT_BUSINESS_PROFILE_EMAIL_ADDRESS_HERE";
8181
params.businessAccountIdentifier = "INSERT_BUSINESS_ACCOUNT_IDENTIFIER_HERE";
82-
params.gmbAccessToken = "INSERT_GMB_ACCESS_TOKEN_HERE";
82+
params.businessProfileAccessToken = "INSERT_BUSINESS_PROFILE_ACCESS_TOKEN_HERE";
8383
}
8484

8585
GoogleAdsClient googleAdsClient = null;
@@ -95,13 +95,13 @@ public static void main(String[] args) throws InterruptedException, IOException
9595
}
9696

9797
try {
98-
new AddGoogleMyBusinessLocationExtensions()
98+
new AddBusinessProfileLocationExtensions()
9999
.runExample(
100100
googleAdsClient,
101101
params.customerId,
102-
params.gmbEmailAddress,
102+
params.businessProfileEmailAddress,
103103
params.businessAccountIdentifier,
104-
params.gmbAccessToken);
104+
params.businessProfileAccessToken);
105105
} catch (GoogleAdsException gae) {
106106
// GoogleAdsException is the base class for most exceptions thrown by an API request.
107107
// Instances of this exception have a message and a GoogleAdsFailure that contains a
@@ -123,61 +123,62 @@ public static void main(String[] args) throws InterruptedException, IOException
123123
*
124124
* @param googleAdsClient the Google Ads API client.
125125
* @param customerId the client customer ID.
126-
* @param gmbEmailAddress email address associated with the GMB account.
127-
* @param businessAccountIdentifier the account number of the GMB account (optional).
128-
* @param gmbAccessToken the access token created using the 'AdWords' scope and the client ID and
129-
* client secret of with the Cloud project associated with the GMB account.
126+
* @param businessProfileEmailAddress email address associated with the Business Profile account.
127+
* @param businessAccountIdentifier the account number of the Business Profile account (optional).
128+
* @param businessProfileAccessToken the access token created using the 'AdWords' scope and the
129+
* client ID and client secret of with the Cloud project associated with the Business Profile
130+
* account.
130131
* @throws GoogleAdsException if an API request failed with one or more service errors.
131132
* @throws InterruptedException if the Thread.sleep operation is interrupted.
132133
*/
133134
private void runExample(
134135
GoogleAdsClient googleAdsClient,
135136
long customerId,
136-
String gmbEmailAddress,
137+
String businessProfileEmailAddress,
137138
String businessAccountIdentifier,
138-
String gmbAccessToken)
139+
String businessProfileAccessToken)
139140
throws InterruptedException {
140-
// Creates a PlacesLocationFeedData object to identify the Google My Business account, specify
141+
// Creates a PlacesLocationFeedData object to identify the Business Profile account, specify
141142
// location filters, and provide authorization for Google Ads to retrieve locations from the
142-
// account on behalf of the user identified by gmbEmailAddress.
143+
// account on behalf of the user identified by businessProfileEmailAddress.
143144
PlacesLocationFeedData.Builder placesLocationFeedData =
144145
PlacesLocationFeedData.newBuilder()
145-
.setEmailAddress(gmbEmailAddress)
146-
// Used to filter Google My Business listings by labels. If entries exist in
146+
.setEmailAddress(businessProfileEmailAddress)
147+
// Used to filter Business Profile listings by labels. If entries exist in
147148
// label_filters, only listings that have at least one of the labels set are
148149
// candidates to be synchronized into FeedItems. If no entries exist in
149150
// label_filters, then all listings are candidates for syncing.
150151
.addLabelFilters("Stores in New York")
151-
// Sets the authentication info to be able to connect Google Ads to the GMB
152+
// Sets the authentication info to be able to connect Google Ads to the Business Profile
152153
// account.
153154
.setOauthInfo(
154155
OAuthInfo.newBuilder()
155156
.setHttpMethod("GET")
156157
.setHttpRequestUrl(GOOGLE_ADS_SCOPE)
157-
.setHttpAuthorizationHeader("Bearer " + gmbAccessToken)
158+
.setHttpAuthorizationHeader("Bearer " + businessProfileAccessToken)
158159
.build());
159160

160161
if (businessAccountIdentifier != null) {
161162
placesLocationFeedData.setBusinessAccountId(businessAccountIdentifier);
162163
}
163164

164-
// [START add_google_my_business_location_extensions]
165-
// Creates a feed that will sync to the Google My Business account. Do not add FeedAttributes to
165+
// [START add_business_profile_location_extensions]
166+
// Creates a feed that will sync to the Business Profile account. Do not add FeedAttributes to
166167
// this object as Google Ads will add them automatically because this will be a system generated
167168
// feed.
168-
Feed.Builder gmbFeed =
169+
Feed.Builder businessProfileFeed =
169170
Feed.newBuilder()
170-
.setName("Google My Business feed #" + getPrintableDateTime())
171-
// Configures the location feed populated from Google My Business Locations.
171+
.setName("Business Profile feed #" + getPrintableDateTime())
172+
// Configures the location feed populated from Business Profile Locations.
172173
.setPlacesLocationFeedData(placesLocationFeedData)
173174
// Since this feed's feed items will be managed by Google,
174175
// you must set its origin to GOOGLE.
175176
.setOrigin(FeedOrigin.GOOGLE);
176177

177-
FeedOperation operation = FeedOperation.newBuilder().setCreate(gmbFeed).build();
178-
// [END add_google_my_business_location_extensions]
178+
FeedOperation operation = FeedOperation.newBuilder().setCreate(businessProfileFeed).build();
179+
// [END add_business_profile_location_extensions]
179180

180-
// [START add_google_my_business_location_extensions_1]
181+
// [START add_business_profile_location_extensions_1]
181182
try (FeedServiceClient feedServiceClient =
182183
googleAdsClient.getLatestVersion().createFeedServiceClient()) {
183184
// Adds the feed. Since it is a system generated feed, Google Ads will automatically:
@@ -186,16 +187,18 @@ private void runExample(
186187
// with the placeholder fields of the LOCATION placeholder type.
187188
MutateFeedsResponse response =
188189
feedServiceClient.mutateFeeds(Long.toString(customerId), ImmutableList.of(operation));
189-
String gmbFeedResourceName = response.getResults(0).getResourceName();
190-
System.out.printf("GMB feed created with resource name: %s%n", gmbFeedResourceName);
191-
// [END add_google_my_business_location_extensions_1]
190+
String businessProfileFeedResourceName = response.getResults(0).getResourceName();
191+
System.out.printf(
192+
"Business Profile feed created with resource name: %s%n",
193+
businessProfileFeedResourceName);
194+
// [END add_business_profile_location_extensions_1]
192195

193-
// [START add_google_my_business_location_extensions_2]
196+
// [START add_business_profile_location_extensions_2]
194197
// Adds a CustomerFeed that associates the feed with this customer for
195198
// the LOCATION placeholder type.
196199
CustomerFeed customerFeed =
197200
CustomerFeed.newBuilder()
198-
.setFeed(gmbFeedResourceName)
201+
.setFeed(businessProfileFeedResourceName)
199202
.addPlaceholderTypes(PlaceholderType.LOCATION)
200203
// Creates a matching function that will always evaluate to true.
201204
.setMatchingFunction(
@@ -212,14 +215,15 @@ private void runExample(
212215

213216
CustomerFeedOperation customerFeedOperation =
214217
CustomerFeedOperation.newBuilder().setCreate(customerFeed).build();
215-
// [END add_google_my_business_location_extensions_2]
218+
// [END add_business_profile_location_extensions_2]
216219

217-
// [START add_google_my_business_location_extensions_3]
220+
// [START add_business_profile_location_extensions_3]
218221
try (CustomerFeedServiceClient customerFeedServiceClient =
219222
googleAdsClient.getLatestVersion().createCustomerFeedServiceClient()) {
220223

221224
// After the completion of the Feed ADD operation above the added feed will not be available
222-
// for usage in a CustomerFeed until the sync between the Google Ads and GMB accounts
225+
// for usage in a CustomerFeed until the sync between the Google Ads and Business Profile
226+
// accounts
223227
// completes. The loop below will retry adding the CustomerFeed up to ten times with an
224228
// exponential back-off policy.
225229
String addedCustomerFeed = null;
@@ -249,7 +253,7 @@ private void runExample(
249253
Thread.sleep(sleepSeconds * 1000);
250254
}
251255
} while (numberOfAttempts < MAX_CUSTOMER_FEED_ADD_ATTEMPTS && addedCustomerFeed == null);
252-
// [END add_google_my_business_location_extensions_3]
256+
// [END add_business_profile_location_extensions_3]
253257

254258
if (addedCustomerFeed == null) {
255259
throw new RuntimeException(

google-ads-examples/src/main/java/com/google/ads/googleads/examples/utils/ArgumentNames.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public final class ArgumentNames {
7171
public static final String FREEFORM_KEYWORD_TEXT = "--freeformKeywordText";
7272
public static final String GCLID = "--gclid";
7373
public static final String GEO_TARGET_CONSTANT_ID = "--geoTargetConstantId";
74-
public static final String GMB_ACCESS_TOKEN = "--gmbAccessToken";
75-
public static final String GMB_EMAIL_ADDRESS = "--gmbEmailAddress";
74+
public static final String BUSINESS_PROFILE_ACCESS_TOKEN = "--businessProfileAccessToken";
75+
public static final String BUSINESS_PROFILE_EMAIL_ADDRESS = "--businessProfileEmailAddress";
7676
public static final String HOTEL_CENTER_ACCOUNT_ID = "--hotelCenterAccountId";
7777
public static final String IMAGE_ASSET_ID = "--imageAssetId";
7878
public static final String ITEM_ID = "--itemId";

0 commit comments

Comments
 (0)