Bing 广告 - 上传线下转化
Bing ads - Upload offline conversion
我正在尝试通过 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&sr=b&sig=%2B74DyfhzKeamKIMLIrHLyH93rwU3WNk6necXpULCrDk%3D&st=2018-04-30T05%3A43%3A16Z&se=2018-04-30T06%3A08%3A16Z&sp=rl</ResultFileUrl>
</GetBulkUploadStatusResponse>
</s:Body>
</s:Envelope>`
但是当我登录我的帐户时,我没有看到任何记录。谁能帮我上传离线记录。
我是不是漏掉了什么。我是否需要在我的沙盒帐户中配置任何其他内容?
建议已在Bing Ads API Development Forum中提出,我确认沙箱不会记录线下转化数据。希望对您有所帮助!
我正在尝试通过 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&sr=b&sig=%2B74DyfhzKeamKIMLIrHLyH93rwU3WNk6necXpULCrDk%3D&st=2018-04-30T05%3A43%3A16Z&se=2018-04-30T06%3A08%3A16Z&sp=rl</ResultFileUrl>
</GetBulkUploadStatusResponse>
</s:Body>
</s:Envelope>`
但是当我登录我的帐户时,我没有看到任何记录。谁能帮我上传离线记录。
我是不是漏掉了什么。我是否需要在我的沙盒帐户中配置任何其他内容?
建议已在Bing Ads API Development Forum中提出,我确认沙箱不会记录线下转化数据。希望对您有所帮助!