Used below sample code from this link 
https://developers.google.com/google-ads/api/docs/conversions/upload-clicks 
, public void Run(GoogleAdsClient client, long customerId, long 
conversionActionId,
    string gclid, string gbraid, string wbraid, string conversionTime,
    double conversionValue)
{
    // Get the ConversionActionService. *Here i am getting the error , 
which was mentioned in post*
    ConversionUploadServiceClient conversionUploadService =
        client.GetService(Services.V12.ConversionUploadService);

    // Creates a click conversion by specifying currency as USD.
    ClickConversion clickConversion = new ClickConversion()
    {
        ConversionAction = ResourceNames.ConversionAction(customerId, 
conversionActionId),
        ConversionValue = conversionValue,
        ConversionDateTime = conversionTime,
        CurrencyCode = "USD"
    };

    // Verifies that exactly one of gclid, gbraid, and wbraid is specified, 
as required.
    // See 
https://developers.google.com/google-ads/api/docs/conversions/upload-clicks
    // for details.
    string[] ids = { gclid, gbraid, wbraid };
    int idCount = ids.Where(id => !string.IsNullOrEmpty(id)).Count();

    if (idCount != 1)
    {
        throw new ArgumentException($"Exactly 1 of gclid, gbraid, or wbraid 
is " +
            $"required, but {idCount} ID values were provided");
    }

    // Sets the single specified ID field.
    if (!string.IsNullOrEmpty(gclid))
    {
        clickConversion.Gclid = gclid;
    }
    else if (!string.IsNullOrEmpty(wbraid))
    {
        clickConversion.Wbraid = wbraid;
    }
    else if (!string.IsNullOrEmpty(gbraid))
    {
        clickConversion.Gbraid = gbraid;
    }

    try
    {
        // Issues a request to upload the click conversion.
        UploadClickConversionsResponse response =
            conversionUploadService.UploadClickConversions(
                new UploadClickConversionsRequest()
                {
                    CustomerId = customerId.ToString(),
                    Conversions = { clickConversion },
                    PartialFailure = true,
                    ValidateOnly = false
                });

        // Prints the result.
        ClickConversionResult uploadedClickConversion = response.Results[0];
        Console.WriteLine($"Uploaded conversion that occurred at " +
            $"'{uploadedClickConversion.ConversionDateTime}' from Google " +
            $"Click ID '{uploadedClickConversion.Gclid}' to " +
            $"'{uploadedClickConversion.ConversionAction}'.");
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}

On Friday, 16 December 2022 at 14:02:43 UTC+5:30 adsapi wrote:

> Hi Amitha,
>
> Thank you for reaching out to us.
>
> For our team to further investigate and validate if the request is done 
> correctly, could you please provide us with the complete API logs (request 
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>  and response 
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
>  with request-id 
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>)
>  
> generated on your end?
>
> Note that this can be requested or provided to the developer handling the 
> Google Ads API transactions when logging of the API requests has been 
> enabled. You may check here 
> <https://developers.google.com/google-ads/api/docs/best-practices/logging#client_library_logging>
>  
> and click your client library for the specific guideline to enable it.
>
> You may then send the requested logs via the Reply privately to author 
> option. If this option is not available, you may send the details directly 
> to our [email protected] alias instead.
>
> Best regards,
> [image: Google Logo] 
> Heidi 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2h3jSU: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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/01fbe3f9-ddaf-4a59-b4e3-c74f22198e4cn%40googlegroups.com.
  • Er... Amitha Shenoy
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Amitha Shenoy
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Amitha Shenoy

Reply via email to