collection_size_error: TOO_MANY

129 views
Skip to first unread message

Ajit Trivedi

unread,
Jul 18, 2022, 3:26:02 PM7/18/22
to Google Ads API and AdWords API Forum

On trying to upload a user to google ads API I am getting the error as collection_size_error: TOO_MANY. I am using the following code snippet to upload users to the audience created in google ads API.

Set userList; //userList contains the hashed email of the user that i want to upload to the audience

List<UserDataOperation> userDataOperations = new ArrayList<>(userList.size()); for (String user : userList) { UserDataOperation userDataOperationEmail = UserDataOperation.newBuilder().setCreate( UserData.newBuilder() .addUserIdentifiers(UserIdentifier.newBuilder().setHashedEmail(user).build()) .build()).build(); userDataOperations.add(userDataOperationEmail); } UploadUserDataRequest.Builder uploadUserDataRequest = UploadUserDataRequest.newBuilder().setCustomerId(clientCustomerId) .setCustomerMatchUserListMetadata( CustomerMatchUserListMetadata.newBuilder().setUserList(resourceName).build()); uploadUserDataRequest.addAllOperations(userDataOperations); try (UserDataServiceClient userDataServiceClient = googleAdsClient.getLatestVersion() .createUserDataServiceClient()) { response = userDataServiceClient.uploadUserData(uploadUserDataRequest.build()); }

What I have observed is that if my userList contain more then 10 values than I get this error.
Thanks

Google Ads API Forum Advisor

unread,
Jul 18, 2022, 3:35:02 PM7/18/22
to ajit.triv...@gmail.com, adwor...@googlegroups.com
Hi Ajit,

Thank you for reaching out to the Google Ads API support team.

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmitabahen Gaurav
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cXHxh:ref

Ajit Trivedi

unread,
Jul 25, 2022, 12:13:52 AM7/25/22
to Google Ads API and AdWords API Forum
Hi,
PFB the request logs.
uploadUserDataRequest customer_id: "<customerid>"
customer_match_user_list_metadata {
  user_list: "customers/<customerid>/userLists/<userList>"
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "00c1ffa2c444c8a50d1e2b3fa85da987215ea93504307bf274fc359ffeef1d"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "00ab8a90f64a7831480dd2b1bd8fa6d533f6c65bd29489d5c19ce6840eedac"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "0038c2d4c6d138f0971fa0abdcb9dc36e888bd41455b4c1d76908233224ae4"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "006d436b75e7427335692acd682ed41c3a155e759bf1dbbc460e8b96c1043"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "00182ff0d1d58dd6aa5bb582fd9451241249f32df089c37ceeb7a2f26ef92"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "008dfcb859cf201bbcf9506e34793fd6f826fa11a688c7e13e81aeef55d41"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "fff53759f1963c6537cf0b127ef72a6ec41abc137b5e360a13b1220cc443"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "000a4fbdac73ee09787d0e51795c32ae6b2f6e977040680f046330a2748aa0"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "00a7b26ac46b5936cfbadb5a39a65e3747163bf58fc8a54756a7d36ef1c107"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "01285fbddaf01ed394ab82b33927e81a6c077bffea2f63e308be4f4bdcf8ba"
    }
  }
}
operations {
  create {
    user_identifiers {
      hashed_phone_number: "014174b4840651407d79d0989dced5b0a309dd55b0069d0fe55bb9a2ff9905"
    }
  }
}

 errors {
  error_code {
    collection_size_error: TOO_MANY
  }
  message: "Too many."
  location {
    field_path_elements {
      field_name: "operations"
    }
  }
}
request_id: "fxFRqgy0SjqEkbhFpRTVzw"

Result errors {  error_code {    collection_size_error: TOO_MANY  }  message: "Too many."  location {    field_path_elements {      field_name: "operations"    }  }}request_id: "fxFRqgy0SjqEkbhFpRTVzw"
0

Reply all
Reply to author
Forward
0 new messages