用于上传批量离线转化的API?

时间:2014-06-05 09:46:35

标签: google-adwords adwords-apiv201402

我可以通过API将单个离线转化上传到我的adwords帐户。但我想通过API上传批量转化。有没有办法在单个API调用中上传批量转换。我正在使用v201402 adwords客户端库。

2 个答案:

答案 0 :(得分:2)

您可以使用" MutateJobService"为了这。这完全符合您的目的 这是链接: https://developers.google.com/adwords/api/docs/reference/v201402/MutateJobService

答案 1 :(得分:0)

https://developers.google.com/adwords/api/docs/guides/importing-conversions

这是我的c#代码

public OfflineConversionFeedReturnValue UploadOfflineConversionsToExistingConversionType(List<OfflineConversionFeed> offlineConversions)
{
    try
    {
        // Get the OfflineConversionFeedService.
        OfflineConversionFeedService offlineConversionFeedService =
            (OfflineConversionFeedService)User.GetService(
                AdWordsService.v201509.OfflineConversionFeedService);

        List<OfflineConversionFeedOperation> offlineConversionOperations = new List<OfflineConversionFeedOperation>();

        foreach (OfflineConversionFeed conversion in offlineConversions)
        {
            OfflineConversionFeedOperation offlineConversionOperation =
            new OfflineConversionFeedOperation();

            offlineConversionOperation.@operator = Operator.ADD;
            offlineConversionOperation.operand = conversion;

            offlineConversionOperations.Add(offlineConversionOperation);
        }

        OfflineConversionFeedReturnValue offlineConversionRetval =
            offlineConversionFeedService.mutate(offlineConversionOperations.ToArray());

        return offlineConversionRetval;
    }
    catch (Exception e)
    {
        throw new System.ApplicationException("Failed upload offline conversions.", e);
    }
}