Example for ConversionUploadService

510 views
Skip to first unread message

Eeshan Kale

unread,
Jun 5, 2019, 8:41:34 AM6/5/19
to AdWords API and Google Ads API Forum
Hi,

I'm working on the migration project from adwords to googleads. Unfortunately, since there are very few examples this time around, which is honestly a huge problem (the vast no of examples for adwords was very beneficial), I'm kind of stuck.

From my understanding, 

1) This step I believe is fine, since I can log it out : 
OfflineConversionFeed feed = new OfflineConversionFeed();
feed.setGoogleClickId(""); 
//other fields like conversionTime etc etc

is to be translated to : 
ClickConversion feed = ClickConversion.newBuilder()
.setConversionAction(StringValue.of(getProductName()))
.setConversionDateTime(StringValue.of(getLeadStartDate())))
.setConversionValue(DoubleValue.of(getRevenue()))
.setGclid(StringValue.of(getSubAffiliatesId()))
.build();

2) I feel this step is also fine cause I can see data correctly 
eg of how data looks : conversions {
  conversion_action {
    value: "Upload"
  }
  conversion_date_time {
    value: "00000000 000000 America/Los_Angeles"
  }
  conversion_value {
    value: 0.0
  }
}

UploadClickConversionsRequest clickConversionRequest = UploadClickConversionsRequest.newBuilder().addAllConversions(feedCollection).build();
Here, feedCollection is an ArrayList<ClickConversion> which is doing nothing but storing data from step (1)

3) I believe this step is also correct since I can log out data for this object.
ConversionUploadServiceClient conversionUploadServiceClient = googleAdsClient.getLatestVersion().createConversionUploadServiceClient();

4) The problematic step, since I cannot log out any error related to this response object. Maybe my logging is wrongfully set? But I've set it to the recommended steps as shown here https://github.com/googleads/google-ads-java/blob/master/README.md (see Request/Response Logging section)
Also if my logging has been setup incorrectly, how am I able to capture the other steps correctly?
I cannot provide any logs for step 4 unfortunately since I'm unable to capture it in the logs.

UploadClickConversionsResponse response = conversionUploadServiceClient.uploadClickConversions(clickConversionRequest); //clickConversionRequest is the object from step 2. I have also tried the 2nd method that has 2 parameters (customerId,List<ClickConversion>) but same result

Any ideas on how do I get this resolved? I'm guessing after this

5) (this step is still not done, but I guess this prototype should be fine?)
for(ClickConversionResult result : response.getResultsList()) {
log("something");
          try {
for (GoogleAdsError error :
      ErrorUtils.getGoogleAdsErrors(operationIndex, response.getPartialFailureError())) {
log("something")
  }
} catch (InvalidProtocolBufferException e1) {
                                               log("something");
}
        ++operationIndex;
}

Let me know if the question was obscure or vague, and I'll try and provide more depth and detail to it.

Google Ads API Forum Advisor Prod

unread,
Jun 5, 2019, 11:12:28 PM6/5/19
to adwor...@googlegroups.com
Hi Eeshan,

Could you confirm if my understanding is correct that your concern is more on logging (using Java) important lines in the code? If yes, you may reach out to the Java client library owners directly via this link for further assistance.

However, if you are getting errors on specific lines of your code, you can simply enable logging for your Java client library and the responses generated should point out the errors you encountered.

Let me know if I understood you correctly.

Best regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UBlcgO:ref

Eeshan Kale

unread,
Jun 6, 2019, 5:35:51 PM6/6/19
to AdWords API and Google Ads API Forum
Hey Peter,

No I don't think the core issue is due to logging unfortunately.
It's the UploadClickConversionsResponse failing to upload the the entries that I plan on uploading (the new 'Mutate' method is uploadClickConversions correct? That step doesn't seem to be proceeding.) 
I'm still trying to fix the logs (since I can see all other Error logs, except in this specific instance)

Google Ads API Forum Advisor Prod

unread,
Jun 6, 2019, 10:56:30 PM6/6/19
to adwor...@googlegroups.com
Hi Eeshan,

Thank you for pointing out the exact issue and my apologies for missing it at the start. So I can better identify what may be causing the issue, could you provide any error strings or messages?

Also, could you confirm if you have already enabled logging for your Java client library? I asked because any issues with the services should be captured by the JSON logs and this should help us accurately determine the cause.

Once enabled, you may retry your request and if the issue persists, you may send to me using the Reply privately to author option the generated JSON logs.

Thanks and regards,

Eeshan Kale

unread,
Jun 7, 2019, 3:16:34 PM6/7/19
to AdWords API and Google Ads API Forum
Hi Peter,

Unfortunately I can't get the logs for that response to pop up. I am certain though the problem is with 'conversionUploadServiceClient.uploadClickConversions(clickConversionRequest)' since after this statement, the program flow stops proceeding. I am also seeing a vast number of complains about how the Google Ads API is way slower than the Adwords API, so I wonder if that could be a problem.

I'm still working on trying to get the logs to work, but any error logs for that statement don't seem to be working (all other logs seem to be working fine)

ashish delacon

unread,
May 1, 2022, 5:31:14 AM5/1/22
to Google Ads API and AdWords API Forum
was this ever resolved?
Because after proper logging with slf4j I can see the error, but the problem is that it keeps on retrying, and that's why the program does not ever proceed to the next line.

How can this retrying be stopped?
I am trying on v10

Google Ads API Forum Advisor

unread,
May 2, 2022, 9:57:58 PM5/2/22
to ash...@delaconcorp.com, adwor...@googlegroups.com
Hi,

Thank you for following up on this thread.

For your conversion upload requests, could you confirm if you are using the Java client library? If not could you specify which client library it is you are using?

In addition, could you also provide your complete request and response logs, and the request-id, generated when you encountered the issue? 

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5001UBlcgO:ref
Reply all
Reply to author
Forward
0 new messages