googleads / googleads-java-lib

Google Ad Manager SOAP API Client Library for Java
Apache License 2.0
226 stars 360 forks source link

how to add a transaction id to offline conversion feed #200

Closed revanth1528 closed 4 years ago

revanth1528 commented 4 years ago

I'm using java sdk(com.google.api-ads) for uploading offline conversions, but the problem is I'm getting a repeat rate of conversions as ~1.5 which is not possible(it is happening because the conversion value get updated frequently for the same transaction and it google ads is counting it as new transaction), so is there a way i can correlate a transaction id with each conversion ?

below is the sample code i'm using

 OfflineConversionFeed feed = new OfflineConversionFeed();
feed.setConversionName(conversionName);
feed.setConversionTime(conversionTime);
feed.setConversionValue(conversionValue);
feed.setGoogleClickId(gClid);

OfflineConversionFeedOperation offlineConversionOperation =
new OfflineConversionFeedOperation();
offlineConversionOperation.setOperator(Operator.ADD);
offlineConversionOperation.setOperand(feed);

OfflineConversionFeedReturnValue offlineConversionReturnValue = null;
try {
offlineConversionReturnValue = offlineConversionFeedService
.mutate(new OfflineConversionFeedOperation[] {offlineConversionOperation});
} catch (RemoteException e) {
log.error("RemoteException while sending update to google, message : {}",e.getMessage());
log.error(ExceptionUtils.getStackTrace(e));
return false;
}catch (Exception e) {
log.error("Exception while sending update to google, message : {}",e.getMessage());
log.error(ExceptionUtils.getStackTrace(e));
return false;
}
nwbirnie commented 4 years ago

Hey, since this question is relating to general API capabilities, and is not specific to the Java client library, please reach out on the forum where our support folks will be able to advise on the path forwards.

Best wishes, Nick