3

Trying to use the DoubleClick API with the Google Client PHP SDK described here https://developers.google.com/doubleclick-advertisers/v3.1/conversions/batchupdate

I'm finding that instead of an update happening, these conversions are being removed from our reports. I suspect something with De-duplication, but I wouldn't expect that the conversion be completely removed.

I'm basically doing this:

    $conversion = new Google_Service_Dfareporting_Conversion();

    $conversion->setKind("dfareporting#conversion");

    $conversion->setGclid($clickId);
    $conversion->setFloodlightActivityId($this->getActivityId());
    $conversion->setFloodlightConfigurationId($this->getConfigId());
    $conversion->setOrdinal($conversionId);
    $conversion->setTimestampMicros($conversionTimestamp);

    $conversion->setQuantity(1);
    $conversion->setValue($revenue);

    $doubleClickSearch = new Google_Service_Dfareporting($this->getGoogleApiClient());
    $conversionList = new Google_Service_Dfareporting_ConversionsBatchUpdateRequest();
    $conversionList->setKind("dfareporting#conversionsBatchUpdateRequest");
    $conversionList->setConversions([$conversion]);
    return $doubleClickSearch->conversions->batchupdate($this->getUserProfileId(), $conversionList);

And when this gets run, it works as expected:

    {"hasFailures":false,
      "kind":"dfareporting#conversionsBatchUpdateResponse",
        "status":[
          {"kind":"dfareporting#conversionStatus",
           "conversion":{  
               "childDirectedTreatment":null,
               "encryptedUserId":null,
               "encryptedUserIdCandidates":null,
               "floodlightActivityId":"redacted",
               "floodlightConfigurationId":"redacted",
               "gclid":"redacted",
               "kind":"dfareporting#conversion",
               "limitAdTracking":null,
               "mobileDeviceId":null,
               "ordinal":"redactedConversionId",
               "quantity":"1",
               "timestampMicros":"1532697843000000",
               "value":885
             }
          }
      ]
   }

But then when we run the report afterwards, this particular conversion is no longer part of it: It doesn't just not take the update, the conversion has been completely removed.

I've verified that the Ordinal, timestamp, gclid, activityId, and configuration IDs all match. Any idea where my conversions are going?

I will note that we are running the batchUpdate command for creations as well. I'm not sure if that would have anything to do with it, but the records do get created as normal.

0 Answers0