@@ -209,6 +209,7 @@ private void runExample(
209209 * @param customerId the client customer ID.
210210 * @return the resource name of the newly created user list.
211211 */
212+ // [START add_customer_match_user_list_3]
212213 private String createCustomerMatchUserList (GoogleAdsClient googleAdsClient , long customerId ) {
213214 // Creates the new user list.
214215 UserList userList =
@@ -243,6 +244,7 @@ private String createCustomerMatchUserList(GoogleAdsClient googleAdsClient, long
243244 return response .getResults (0 ).getResourceName ();
244245 }
245246 }
247+ // [END add_customer_match_user_list_3]
246248
247249 /**
248250 * Creates and executes an asynchronous job to add users to the Customer Match user list.
@@ -487,13 +489,13 @@ private List<OfflineUserDataJobOperation> buildOfflineUserDataJobOperations()
487489 userDataList .add (userDataBuilder .build ());
488490 }
489491 }
490- // [END add_customer_match_user_list_2]
491492
492493 // Creates the operations to add users.
493494 List <OfflineUserDataJobOperation > operations = new ArrayList <>();
494495 for (UserData userData : userDataList ) {
495496 operations .add (OfflineUserDataJobOperation .newBuilder ().setCreate (userData ).build ());
496497 }
498+ // [END add_customer_match_user_list_2]
497499
498500 return operations ;
499501 }
@@ -538,6 +540,7 @@ private String normalizeAndHash(MessageDigest digest, String s, boolean trimInte
538540 * @param offlineUserDataJobResourceName the resource name of the OfflineUserDataJob to get the
539541 * status for.
540542 */
543+ // [START add_customer_match_user_list_4]
541544 private void checkJobStatus (
542545 GoogleAdsClient googleAdsClient , long customerId , String offlineUserDataJobResourceName ) {
543546 try (GoogleAdsServiceClient googleAdsServiceClient =
@@ -583,6 +586,7 @@ private void checkJobStatus(
583586 }
584587 }
585588 }
589+ // [END add_customer_match_user_list_4]
586590
587591 /**
588592 * Prints information about the Customer Match user list.
@@ -593,6 +597,7 @@ private void checkJobStatus(
593597 */
594598 private void printCustomerMatchUserListInfo (
595599 GoogleAdsClient googleAdsClient , long customerId , String userListResourceName ) {
600+ // [START add_customer_match_user_list_5]
596601 try (GoogleAdsServiceClient googleAdsServiceClient =
597602 googleAdsClient .getLatestVersion ().createGoogleAdsServiceClient ()) {
598603 // Creates a query that retrieves the user list.
@@ -613,6 +618,7 @@ private void printCustomerMatchUserListInfo(
613618 // Issues the search stream request.
614619 ServerStream <SearchGoogleAdsStreamResponse > stream =
615620 googleAdsServiceClient .searchStreamCallable ().call (request );
621+ // [END add_customer_match_user_list_5]
616622
617623 // Gets the first and only row from the response.
618624 GoogleAdsRow googleAdsRow = stream .iterator ().next ().getResultsList ().get (0 );
0 commit comments