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);
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/7ea25eb9-a904-4e48-9083-b2b3630f1814n%40googlegroups.com.