Bing Ads Offline Conversion confusion after proper OATH process

328 Views Asked by At

I am using https://github.com/BingAds/BingAds-PHP-SDK to send offline conversion data to Bing. I am successfully able to connect and call different service using OATH. But when I am trying to send offline conversion request I am failed. Bing SOAP request's example for Offline conversion requests https://msdn.microsoft.com/en-us/library/bing-ads-campaign-management-applyofflineconversions.aspx

Now, I need help from you guys, If I want to send ApplyOfflineConversionsRequest what approach should I use SoapVar and then CampaignManagement ApplyOfflineConversions? I am asking this because I am not very well known about the Bing API v11.

After my proper OATH process

//Setting the account id as CustomerAccountId in the header element as per Bing API Doc

  $GLOBALS['AuthorizationData']->AccountId = $obj->Id;

 //send offline conversion
 $offline = new OfflineConversion();
 $offline->ConversionCurrencyCode = 'USD';
 $offline->ConversionName = 'OfflineConversionSellOfRentals';
 $offline->ConversionTime =  date('Y-m-d\TH:i:s', strtotime('-7 days'));
 $offline->ConversionValue = 2.5;
 $offline->MicrosoftClickId = '8349a6501442491186ce602ca56881fe';
 $offline_response = new SoapVar($offline, SOAP_ENC_OBJECT, 'OfflineConversion', $GLOBALS['CampaignProxy']->GetNamespace());
 $request[] = $offline_response;
 $offline_response = CampaignManagementHelper::ApplyOfflineConversions($request);

 print_r($offline_response);

I have created a static method inside CampaignManagementHelper.php file because I didn't find any implementation of AddOfflineConversion method on the Bing API SDK.

 static function AddOfflineConversion($offline){        

   $GLOBALS['Proxy'] = $GLOBALS['CampaignProxy']; 

   $request = new ApplyOfflineConversionsRequest();  

   $request->OfflineConversions[] = $offline;      

  return $GLOBALS['CampaignProxy']->GetService()->ApplyOfflineConversions($request);     

}

I am able to import offline CSV conversion that means My UET Tags and Conversion Goal are enabled.

I am having a hard time because I didn't get any sample example for how to request for offline conversion requests.

Response from Bing API call:

stdClass Object
(
    [PartialErrors] => stdClass Object
        (
        )
)
0

There are 0 best solutions below