My api conversions don't count.

53 views
Skip to first unread message

Trustin Soft

unread,
Apr 29, 2024, 5:39:00 PM4/29/24
to Google Ads API and AdWords API Forum
Im sending my conversions from server via google ads api. but its not visible in web-interface. Im getting successful answer Uploaded a lead conversion for conversion action with ID 6794****.  Here is my code. Can somebody help me figure out what is the problem. Should I use import from database or what? 
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile('google_ads_php.ini')
->build();

$googleAdsClient = (new GoogleAdsClientBuilder())
->fromFile('google_ads_php.ini')
->withOAuth2Credential($oAuth2Credential)
->build();


try {

$conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();

$request = new UploadClickConversionsRequest();
$request->setPartialFailure(true);
$request->setCustomerId($customerId);
$conversion = new ClickConversion();
$conversion->setConversionAction(ResourceNames::forConversionAction($customerId, $conversionActionId));
$conversion->setConversionDateTime($conversionDateTime->format('Y-m-d\TH:i:s\Z'));
$conversion->setConversionValue($var_sum); // Set the conversion value

if (strpos($var_gclid, "wb_") === 0) {
$GCLID = null;
$GBRAID = null;
$WBRAID = substr($var_gclid,3);
$conversion->setWbraid($WBRAID);
} elseif (strpos($var_gclid, "gb_") === 0) {
$GCLID = null;
$GBRAID = substr($var_gclid,3);
$WBRAID = null;
$conversion->setGbraid($GBRAID);
} else {
$GCLID = $var_gclid;
$GBRAID = null;
$WBRAID = null;
$conversion->setGclid($GCLID);
}

$request->setConversions([$conversion]);

$conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();

$conversionUploadServiceClient->uploadClickConversions($request);


Google Ads API Forum Advisor

unread,
Apr 30, 2024, 7:15:13 AM4/30/24
to zandr...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

I understand that you have uploaded the conversions using the Google Ads API, but the conversions are not visible in the Google Ads UI. Kindly note that it takes up to 3 hours for imported conversion statistics to appear in your Google Ads account for last-click attribution. For other search attribution models, it can take longer than 3 hours. I would suggest you refer to the data freshness guide for more information. 

Also, I could see that you have provided only the code snippet. In order to investigate the issue further, provide us with the updated complete API logs (request and response with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tIpYj:ref" (ADR-00233091)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages