AdGroupCriterionService AdGroupCriterionError.CONCRETE_TYPE_REQUIRED

31 views
Skip to first unread message

Zied Chaari

unread,
Mar 12, 2019, 9:35:53 AM3/12/19
to AdWords API and Google Ads API Forum
Hi all,

When I'm trying to add a new AdGroupCriterion, I get this error AdGroupCriterionError.CONCRETE_TYPE_REQUIRED.
You can find attached to request and response log. And bellow the code source.

Thanks,
Zied

using (AdGroupCriterionService adGroupCriterionService = (AdGroupCriterionService)user.GetService(AdWordsService.v201809.AdGroupCriterionService))
            {
                Gender Male = new Gender()
                {
                    id = 11,
                    genderType = GenderGenderType.GENDER_FEMALE,
                    type = CriterionType.GENDER
                };
                AgeRange ageRange = new AgeRange() {
                    id = 503004,
                    ageRangeType = AgeRangeAgeRangeType.AGE_RANGE_45_54,
                    type = CriterionType.AGE_RANGE
                };
                List<Criterion> criteria = new List<Criterion>()
                {
                    Male,
                    ageRange
                };
                List<AdGroupCriterionOperation> operations = new List<AdGroupCriterionOperation>();
                foreach (Criterion criterion in criteria)
                {
                    AdGroupCriterionOperation operation = new AdGroupCriterionOperation()
                    {
                        operand = new AdGroupCriterion()
                        {
                            adGroupId = 57651502050,
                            criterion = criterion
                        },
                        @operator = Operator.ADD
                    };
                    operations.Add(operation);
                }
                try
                {
                    AdGroupCriterionReturnValue retVal = adGroupCriterionService.mutate(operations.ToArray());
                }
                catch (Exception e)
                {
                    throw;
                }
            }
request.xml
response.xml

googleadsapi...@google.com

unread,
Mar 12, 2019, 6:53:53 PM3/12/19
to AdWords API and Google Ads API Forum
Hello Zied, 

The CONCRETE_TYPE_REQUIRED error usually occurs if you are not specifying the type of Criterion that you are trying to mutate. Based on your SOAP request, it seems like you did not specify the type in your operand. You may refer to the attached sample response log for this operation. Can you please give this a try and let me know if you're having any issues?

Thanks,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Sample_Logs.rtf

Zied Chaari

unread,
Mar 13, 2019, 2:10:00 PM3/13/19
to AdWords API and Google Ads API Forum
Hi Bharani,

Thank you for the attached file.
I reproduce my code with Google Ads API V1.0 and it's working fine.

Just a quick question, do you think that I should use Google Ads Api in the future or continue with Google AdWords? 
Cause between us I think I will migrate to Google Ads 

Thanks :) 

googleadsapi...@google.com

unread,
Mar 13, 2019, 7:30:18 PM3/13/19
to AdWords API and Google Ads API Forum
Hello Zied, 

You could plan your API migration by following this guide. You could also check the complete transition timeline in the shared link.

Let me know if you have any other questions.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages