// Get the ConversionTrackerService.
ConversionTrackerServiceInterface conversionTrackerService =
user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);
// Get the OfflineConversionFeedService.
OfflineConversionFeedServiceInterface offlineConversionFeedService =
user.getService(AdWordsService.V201309.OFFLINE_CONVERSION_FEED_SERVICE);
// 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);
feed.setConversionValue(conversionValue);
feed.setGoogleClickId(gClid);
OfflineConversionFeedOperation offlineConversionOperation =
new OfflineConversionFeedOperation();
offlineConversionOperation.setOperator(Operator.ADD);
offlineConversionOperation.setOperand(feed);
OfflineConversionFeedReturnValue offlineConversionReturnValue = offlineConversionFeedService
.mutate(new OfflineConversionFeedOperation[] {offlineConversionOperation});
OfflineConversionFeed newFeed = offlineConversionReturnValue.getValue(0);
System.out.printf(