Hello,
I used to upload offline conversion using following code in v201809 version 
as provided at
https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201809/Remarketing/UploadOfflineConversions.php

$oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();
$session = (new 
AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->withClientCustomerId($customerid)->enablePartialFailure()->build();

$adWordsServices = new AdWordsServices();
$offlineConversionService = $adWordsServices->get($session, 
OfflineConversionFeedService::class);
$conversionName="OfflineConv";
$feed = new OfflineConversionFeed();
$feed->setConversionName($conversionName);
$feed->setConversionTime($conversionTime);
$feed->setConversionValue($conversionValue);
$feed->setGoogleClickId($gclid);

$offlineConversionOperation = new OfflineConversionFeedOperation();
$offlineConversionOperation->setOperator(Operator::ADD);
$offlineConversionOperation->setOperand($feed);
$offlineConversionOperations = [$offlineConversionOperation];
$result = $offlineConversionService->mutate($offlineConversionOperations);


Now I am upgrading to V9, I have used the code as provided at
https://github.com/googleads/google-ads-php/blob/main/examples/Remarketing/UploadOfflineConversion.php

$oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();
$googleAdsClient = (new 
GoogleAdsClientBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->build();

//$conversionName="OfflineConv";
$conversionName = ConversionActionType::WEBPAGE;
$clickConversion = new ClickConversion([
'conversion_action' => ResourceNames::forConversionAction($customerId, 
$conversionName),
'gclid' => $gclid,
'conversion_value' => $conversionValue,
'conversion_date_time' => $conversionTime,
'currency_code' => 'USD'
]);
$conversionUploadServiceClient = 
$googleAdsClient->getConversionUploadServiceClient();
$result = 
$conversionUploadServiceClient->uploadClickConversions($customerid, 
[$clickConversion], true);

The problem is when we set $conversionName="OfflineConv"; we get following 
error.
Resource name 'customers/9025381111/conversionActions/OfflineConv' is 
malformed: expected 
'customers/{customer_id}/conversionActions/{ConversionType.conversion_type_id}'.,
 
at conversions[0].conversion_action

and when we set $conversionName = ConversionActionType::WEBPAGE; we get 
following error.
This customer does not have an import conversion action that matches the 
conversion action provided., at conversions[0].conversion_action

Can someone help me?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/95fb5256-9e29-4cd9-b372-d4b8482750c5n%40googlegroups.com.
  • Up... MWA
    • ... MWA
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to