// Replace with a valid value from your account.
long conversionId = Long.parseLong("INSERT_CONVERSION_ID_HERE");
// Create conversion with updated status and name.
AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
adWordsConversionTracker.setId(conversionId);
adWordsConversionTracker.setStatus(ConversionTrackerStatus.DISABLED);
// Create operations.
ConversionTrackerOperation operation = new ConversionTrackerOperation();
operation.setOperand(adWordsConversionTracker);
operation.setOperator(Operator.SET);
ConversionTrackerOperation[] operations = new ConversionTrackerOperation[] {operation};
// Update conversion.
ConversionTrackerReturnValue result = service.mutate(operations);
// Display conversion.
if (result != null && result.getValue() != null) {
for (ConversionTracker conversionTracker : result.getValue()) {
if (conversionTracker instanceof AdWordsConversionTracker) {
AdWordsConversionTracker newAdWordsConversionTracker =
(AdWordsConversionTracker) conversionTracker;
System.out.printf("Conversion with id \"%d\", name \"%s\", status \"%s\", "
+ "category \"%s\" and snippet \"%s\" was updated.\n",
newAdWordsConversionTracker.getId(), newAdWordsConversionTracker.getName(),
newAdWordsConversionTracker.getStatus(), newAdWordsConversionTracker.getCategory(),
newAdWordsConversionTracker.getSnippet());
} else {
System.out.printf("Conversion with id \"%d\", name \"%s\", status \"%s\", "
+ "category \"%s\" was updated.\n", conversionTracker.getId(),
conversionTracker.getName(), conversionTracker.getStatus(),
conversionTracker.getCategory());