Bing广告 - 上传离线转化

时间:2018-04-30 07:10:23

标签: bing bing-api bing-ads-api

我正在尝试通过API将我的离线转化上传到bing广告。我正在使用下面的代码。现在我正在使用沙盒帐户来测试它。

val authorizationData = AuthorizationData().apply {
    developerToken = "BBD37VB98"
    authentication = PasswordAuthentication("xyz", "xyz")
    customerId = 0
    accountId = 0
}


var bulkOfflineConversion = BulkOfflineConversion().apply {
    clientId = "xyz"
    offlineConversion = OfflineConversion().apply {
        conversionCurrencyCode = "USD"
        conversionName = "phone_sales"
        conversionTime = Calendar.getInstance()
        conversionValue = 10.00
        microsoftClickId = "f894f652ea334e739002f7167ab8f8e3"
    }
}

val uploadEntities = ArrayList<BulkEntity>()
uploadEntities.add(bulkOfflineConversion)

var entityUploadParameters = EntityUploadParameters().apply {
    entities = uploadEntities
    responseMode = ResponseMode.ERRORS_AND_RESULTS
    resultFileDirectory = File("/tmp/")
    resultFileName = "bing.csv"
    overwriteResultFile = true
}

//BulkServiceManager(authorizationData).

var task = BulkServiceManager(authorizationData).uploadEntitiesAsync(entityUploadParameters, null).get()

val resultEntities = ArrayList<BulkEntity>()
task.forEach {
    resultEntities.add(it)
}

task.close()

执行上述代码后,我得到了以下XML响应

<?xml version="1.0" encoding="UTF-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
       <h:TrackingId xmlns:h="https://bingads.microsoft.com/CampaignManagement/v11">b0e0e060-70fd-4bc2-9f40-b1ebcf38adb6</h:TrackingId>
    </s:Header>
    <s:Body>
       <GetBulkUploadStatusResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v11">
          <Errors xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true" />
          <ForwardCompatibilityMap xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
          <PercentComplete>100</PercentComplete>
          <RequestStatus>Completed</RequestStatus>     <ResultFileUrl>https://bingadsappsstoragesi.blob.core.windows.net/bulkuploadresultfiles/6883bbd6-cdd5-4f1b-b1cf-65995601afd0.zip?sv=2015-12-11&amp;sr=b&amp;sig=%2B74DyfhzKeamKIMLIrHLyH93rwU3WNk6necXpULCrDk%3D&amp;st=2018-04-30T05%3A43%3A16Z&amp;se=2018-04-30T06%3A08%3A16Z&amp;sp=rl</ResultFileUrl>
       </GetBulkUploadStatusResponse>
   </s:Body>
</s:Envelope>`

但是当我登录我的帐户时,我看不到任何记录。有人可以帮我上传我的离线记录。

我错过了这里的一些东西。我是否需要在沙箱帐户中配置其他任何内容?

1 个答案:

答案 0 :(得分:0)

Bing Ads API Development Forum已提出建议,我确认沙箱不会记录离线转化数据。我希望这有帮助!