I have attached details log file for further investigation. Please let me 
know what the issue is

*What i am trying to do: *I am trying to add multiple conversions to a 
campaign using Adwords API.

*Code:* C#
List<CampaignOperation> operations = new List<CampaignOperation>();

                using (GoogleService.CampaignService campaignService = 
(GoogleService.CampaignService)user.GetService(AdWordsService.v201809.CampaignService))
                {

                    Campaign campaign = new Campaign
                    {
                        id = Convert.ToInt64(IDHERE)
                    };

                SelectiveOptimization optimize = new 
SelectiveOptimization();
                optimize.conversionTypeIds = new long[] { 589653082L, 
588617162L };
                ListOperations listOperation = new ListOperations();
                listOperation.operators = new ListOperationsListOperator[] 
{ ListOperationsListOperator.PUT, ListOperationsListOperator.PUT };
                optimize.conversionTypeIdsOps = listOperation;
                campaign.selectiveOptimization = optimize;
   

                // Create the operation.
                CampaignOperation operation = new CampaignOperation
                {
                    @operator = Operator.SET,
                    operand = campaign
                };

                operations.Add(operation);
                CampaignReturnValue retVal = null;
                try
                {
                    // Add the campaign.
                    retVal = campaignService.mutate(operations.ToArray());
                }
                catch (Exception campaignEx)
                {
                    throw campaignEx;
                }

Thank You,
Pradeep Datla.

On Friday, May 21, 2021 at 11:33:42 AM UTC-7 adsapiforumadvisor wrote:

> Hello,
>
> Thanks for reaching out. Can you please provide us with the complete 
> request and response logs for this issue?
>
> Thanks,
> Matt
> Google Ads API Team
>
> [image: Google Logo] 
> Matt 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2HCXjz:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/41c29761-4f10-44e8-b308-366e856754cfn%40googlegroups.com.
AdsClientLibs.DetailedRequestLogs Information: 1 : 
-----------------BEGIN API CALL---------------------

Request
-------

POST /api/adwords/cm/v201809/CampaignService
VsDebuggerCausalityData: 
uIDPo3MJVIlH5J9JmnDn7A572MoAAAAA0o4hWobXy0aGJ2Fxxxa7/6y/mDk43bNBqjjd5XmZSvAACQAA
Authorization: REDACTED
Accept-Encoding: gzip, deflate
TimeStamp: Mon, 24 May 2021 16:59:03 GMT


<?xml version="1.0" encoding="utf-16"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/";>
  <s:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
      <clientCustomerId>5928488252</clientCustomerId>
      <developerToken>REDACTED</developerToken>
      <userAgent>unknown (AwApi-DotNet/24.9.0, Common-Dotnet/9.5.0, .NET 
CLR/4.0.30319.42000, Logging, OAuthServiceAccountFlow, gzip)</userAgent>
    </RequestHeader>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
      <operations>
        <operator>SET</operator>
        <operand>
          <id>10649110201</id>
          <selectiveOptimization>
            <conversionTypeIds>589653082</conversionTypeIds>
            <conversionTypeIds>588617162</conversionTypeIds>
            <conversionTypeIdsOps>
              <operators>PUT</operators>
              <operators>PUT</operators>
            </conversionTypeIdsOps>
          </selectiveOptimization>
        </operand>
      </operations>
    </mutate>
  </s:Body>
</s:Envelope>

Response
--------

Content-Type: text/xml; charset=UTF-8
Content-Encoding: 
Date: Mon, 24 May 2021 23:59:03 GMT
Expires: Mon, 24 May 2021 23:59:03 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; 
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; 
ma=2592000; v="46,43"
Transfer-Encoding: chunked
TimeStamp: Mon, 24 May 2021 16:59:03 GMT


<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Header>
    <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
      <requestId>0005c31c31a803e80aa791586e0980cb</requestId>
      <serviceName>CampaignService</serviceName>
      <methodName>mutate</methodName>
      <operations>1</operations>
      <responseTime>206</responseTime>
    </ResponseHeader>
  </soap:Header>
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      
<faultstring>[CampaignError.CAMPAIGN_CANNOT_SET_MORE_THAN_ONE_CONVERSION_TYPE_ID
 @ operations[0].operand.selectiveOptimization.conversionTypeIds; 
trigger:'SEARCH']</faultstring>
      <detail>
        <ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
          
<message>[CampaignError.CAMPAIGN_CANNOT_SET_MORE_THAN_ONE_CONVERSION_TYPE_ID @ 
operations[0].operand.selectiveOptimization.conversionTypeIds; 
trigger:'SEARCH']</message>
          <ApplicationException.Type>ApiException</ApplicationException.Type>
          <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="CampaignError">
            
<fieldPath>operations[0].operand.selectiveOptimization.conversionTypeIds</fieldPath>
            <fieldPathElements>
              <field>operations</field>
              <index>0</index>
            </fieldPathElements>
            <fieldPathElements>
              <field>operand</field>
            </fieldPathElements>
            <fieldPathElements>
              <field>selectiveOptimization</field>
            </fieldPathElements>
            <fieldPathElements>
              <field>conversionTypeIds</field>
            </fieldPathElements>
            <trigger>SEARCH</trigger>
            
<errorString>CampaignError.CAMPAIGN_CANNOT_SET_MORE_THAN_ONE_CONVERSION_TYPE_ID</errorString>
            <ApiError.Type>CampaignError</ApiError.Type>
            <reason>UNKNOWN</reason>
          </errors>
        </ApiExceptionFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
-----------------END API CALL-----------------------

Reply via email to