OfflineConversionFeedServiceInterface offlineConversionFeedService =
adWordsServices.get(session, OfflineConversionFeedServiceInterface.class);
// Create an upload conversion. Once created, this entry will be visible
// under Tools and Analysis->Conversion and will have "Source = Import".
UploadConversion uploadConversion = new UploadConversion();
uploadConversion.setCategory(ConversionTrackerCategory.PAGE_VIEW);
uploadConversion.setName(conversionName);
uploadConversion.setViewthroughLookbackWindow(30);
uploadConversion.setCtcLookbackWindow(90);
ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation();
uploadConversionOperation.setOperator(Operator.ADD);
uploadConversionOperation.setOperand(uploadConversion);
ConversionTrackerReturnValue conversionTrackerReturnValue = conversionTrackerService.mutate(
new ConversionTrackerOperation[] {uploadConversionOperation});
UploadConversion newUploadConversion =
(UploadConversion) conversionTrackerReturnValue.getValue(0);
System.out.printf("New upload conversion type with name = '%s' and ID = %d was created.\n",
newUploadConversion.getName(), newUploadConversion.getId());
// Associate offline conversions with the upload conversion we created.
OfflineConversionFeed feed = new OfflineConversionFeed();
feed.setConversionName(conversionName);
feed.setConversionTime(conversionTime);