I am getting the following error when reporting offline conversion 
operation using google ads api


SUCCESS REQUEST SUMMARY. Method: 
google.ads.googleads.v9.services.ConversionUploadService/UploadClickConversions,
 
Endpoint: googleads.googleapis.com:443, CustomerID: 9342295754, RequestID: 
NXnXyLmU-DDqGP_Qa4yKSg, ResponseCode: OK, Fault: null.

Partial failure occurred: error_code {
  conversion_upload_error: TOO_RECENT_EVENT
}
message: "The click associated with the given identifier or iOS URL 
parameter occurred less than 6 hours ago, please retry after 6 hours have 
passed."
trigger {
  string_value: 
"Cj0KCQiAi9mPBhCJARIsAHchl1xh7WIX2Agye9_7bJzvC3KWzLPpifigrIbvefcc6K5vDgdh-DDqfAYaApfeEALw_wcB"
}
location {
  field_path_elements {
    field_name: "conversions"
    index: 0
  }
  field_path_elements {
    field_name: "gclid"
  }
}

1、At what point does the 6 hours start?
2、Other errors will be reported after 6 hours, the errors are as follows:
Partial failure occurred: The click associated with the given identifier or 
iOS URL parameter isn't from the account where conversion tracking is set 
up.

My account structure is like this, my manager account id is 9634597629 and 
my client id is 9342295754. The client ID is using the conversion action 
created by the manager account

Java:

public class UploadOfflineConversion1 {
private static class UploadOfflineConversionParams {

private long customerId;

private long conversionActionId;

private String gclid;

private String conversionDateTime;

private Double conversionValue;

// Optional: Specify the conversion custom variable ID and value you want to
// associate with the click conversion upload.
private Long conversionCustomVariableId;

private String conversionCustomVariableValue;

// Optional: Specify the unique order ID for the click conversion.
private String orderId;
}

public static void main(String[] args) {
UploadOfflineConversionParams params = new UploadOfflineConversionParams();

// Either pass the required parameters for this example on the command 
line, or insert them
// into the code here. See the parameter class definition above for 
descriptions.
params.customerId = Long.parseLong("9342295754");
params.conversionActionId = Long.parseLong("849097845");
params.gclid = 
"Cj0KCQiAi9mPBhCJARIsAHchl1xh7WIX2Agye9_7bJzvC3KWzLPpifigrIbvefcc6K5vDgdh-DDqfAYaApfeEALw_wcB";

params.conversionDateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd 
HH:mm:ss+08:00");
params.conversionValue = Double.parseDouble("111");
// Optionally specify the conversion custom variable ID and value you want 
to
// associate with the click conversion upload.
params.conversionCustomVariableId = null;
params.conversionCustomVariableValue = null;
// Optionally specify the order ID for the click conversion.
params.orderId = null;

GoogleAdsClient googleAdsClient = null;
try {
long loginCustomID = 9634597629L;
googleAdsClient = GoogleAdsClient.newBuilder
().setLoginCustomerId(loginCustomID)
.setDeveloperToken("xxxxxx")
.fromPropertiesFile()
.build();
} catch (FileNotFoundException fnfe) {
System.err.printf(
"Failed to load GoogleAdsClient configuration from file. Exception: %s%n", 
fnfe);
System.exit(1);
} catch (IOException ioe) {
System.err.printf("Failed to create GoogleAdsClient. Exception: %s%n", ioe);
System.exit(1);
}
try {
new UploadOfflineConversion1()
.runExample(
googleAdsClient,
params.customerId,
params.conversionActionId,
params.gclid,
params.conversionDateTime,
params.conversionValue,
params.conversionCustomVariableId,
params.conversionCustomVariableValue,
params.orderId);
} catch (GoogleAdsException gae) {
// GoogleAdsException is the base class for most exceptions thrown by an 
API request.
// Instances of this exception have a message and a GoogleAdsFailure that 
contains a
// collection of GoogleAdsErrors that indicate the underlying causes of the
// GoogleAdsException.
System.err.printf(
"Request ID %s failed due to GoogleAdsException. Underlying errors:%n",
gae.getRequestId());
int i = 0;
for (GoogleAdsError googleAdsError : 
gae.getGoogleAdsFailure().getErrorsList()) {
System.err.printf(" Error %d: %s%n", i++, googleAdsError);
}
System.exit(1);
}
}

/**
* Runs the example.
*
* @param googleAdsClient the Google Ads API client.
* @param customerId the client customer ID.
* @param conversionActionId conversion action ID associated with this 
conversion.
* @param gclid the GCLID for the conversion.
* @param conversionDateTime date and time of the conversion.
* @param conversionValue the value of the conversion.
* @param conversionCustomVariableId the ID of the conversion custom 
variable to associate with
* the upload.
* @param conversionCustomVariableValue the value of the conversion custom 
variable to associate
* with the upload.
* @param orderId the unique ID (transaction ID) of the conversion.
*/
// [START upload_offline_conversion]
private void runExample(
GoogleAdsClient googleAdsClient,
long customerId,
long conversionActionId,
String gclid,
String conversionDateTime,
Double conversionValue,
Long conversionCustomVariableId,
String conversionCustomVariableValue,
String orderId) {
// Gets the conversion action resource name.


String conversionActionResourceName =
ResourceNames.conversionAction(customerId, conversionActionId);
// Creates the click conversion.
ClickConversion.Builder clickConversionBuilder =
ClickConversion.newBuilder()
.setConversionAction(conversionActionResourceName)
.setConversionDateTime(conversionDateTime)
.setConversionValue(conversionValue)
.setCurrencyCode("USD")
.setGclid(gclid);

ClickConversion clickConversion = clickConversionBuilder.build();

// Creates the conversion upload service client.
try (ConversionUploadServiceClient conversionUploadServiceClient =
googleAdsClient.getLatestVersion().createConversionUploadServiceClient()) {
// Uploads the click conversion. Partial failure should always be set to 
true.
UploadClickConversionsResponse response =
conversionUploadServiceClient.uploadClickConversions(
UploadClickConversionsRequest.newBuilder()
.setCustomerId(Long.toString(customerId))
.addConversions(clickConversion)
// Enables partial failure (must be true).
.setPartialFailure(true)
.build());

// Prints any partial errors returned.
if (response.hasPartialFailureError()) {
GoogleAdsFailure googleAdsFailure =
ErrorUtils.getInstance
().getGoogleAdsFailure(response.getPartialFailureError());
googleAdsFailure
.getErrorsList()
.forEach(e -> System.out.println("Partial failure occurred: " + e));
}

// Prints the result.
ClickConversionResult result = response.getResults(0);
// Only prints valid results.
if (result.hasGclid()) {
System.out.printf(
"Uploaded conversion that occurred at '%s' from Google Click ID '%s' to 
'%s'.%n",
result.getConversionDateTime(), result.getGclid(), 
result.getConversionAction());
}
}
}
// [END upload_offline_conversion]
}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/521c08ac-eaf7-4154-9781-e7c152bf1ee6n%40googlegroups.com.

Reply via email to