Synchronous endpoint returns null even if there is data

analytics

#1

Hi! :slight_smile:

I have just updated our Ads API to v4, and, I don’t know if this is related to the v4 update, but the synchronous endpoint for getting the stats does not return data even for 7 day intervals which do have data in the web interface.

Account ID: 18ce53xfoph

Response:

array(
   'data_type' => 'stats',
   'time_series_length' => 1,
   'data' => 
  array (
    0 => 
    array(
       'id' => 'ivs1r',
       'id_data' => 
      array (
        0 => 
        array(
           'segment' => NULL,
           'metrics' => 
          array(
             'billed_charge_local_micro' => NULL,
             'billed_engagements' => NULL,
          ),
        ),
      ),
    ),
  ),
   'request' => 
  array(
     'params' => 
    array(
       'start_time' => '2019-02-21T22:00:00Z',
       'segmentation_type' => NULL,
       'entity_ids' => 
      array (
        0 => 'ivs1r',
      ),
       'end_time' => '2019-02-28T22:00:00Z',
       'country' => NULL,
       'placement' => 'ALL_ON_TWITTER',
       'granularity' => 'TOTAL',
       'entity' => 'FUNDING_INSTRUMENT',
       'platform' => NULL,
       'metric_groups' => 
      array (
        0 => 'BILLING',
      ),
    ),
  ),
)

The interval of time is exactly 7 days. I have also tried with 6 days just to be sure, but the result is the same.

The funding instrument for which I’m trying to get the data is not able to fund because it is EXPIRED, but its status is ACTIVE and deleted: false, and I assume I should be able to get the data for it.

Does anyone have any ideas about what might be happening?

Thank you!


#2

@juanshishido: maybe you can help me here, please?

Thank you.


#3

Thanks for the question, @majoritasdev. Could you help me understand where you’re seeing spend in the web interface? I’m not seeing spend for that funding instrument for that date range.

(Also, not related to v4 :slight_smile: )


#4

Thank you, @juanshishido! :slight_smile:

Ok, I found the UI page for that funding instrument, and indeed, there was no spend for that period of time, but I found another interval for which there is spend, and the API returns null:

// for placement 'PUBLISHER_NETWORK'
array(
   'data_type' => 'stats',
   'time_series_length' => 1,
   'data' => 
  array (
    0 => 
    array(
       'id' => 'ivs1r',
       'id_data' => 
      array (
        0 => 
        array(
           'segment' => NULL,
           'metrics' => 
          array(
             'billed_charge_local_micro' => NULL,
             'billed_engagements' => NULL,
          ),
        ),
      ),
    ),
  ),
   'request' => 
  array(
     'params' => 
    array(
       'start_time' => '2019-01-31T22:00:00Z',
       'segmentation_type' => NULL,
       'entity_ids' => 
      array (
        0 => 'ivs1r',
      ),
       'end_time' => '2019-02-06T22:00:00Z',
       'country' => NULL,
       'placement' => 'PUBLISHER_NETWORK',
       'granularity' => 'TOTAL',
       'entity' => 'FUNDING_INSTRUMENT',
       'platform' => NULL,
       'metric_groups' => 
      array (
        0 => 'BILLING',
      ),
    ),
  ),
)

// for placement 'ALL_ON_TWITTER'
array(
   'data_type' => 'stats',
   'time_series_length' => 1,
   'data' => 
  array (
    0 => 
    array(
       'id' => 'ivs1r',
       'id_data' => 
      array (
        0 => 
        array(
           'segment' => NULL,
           'metrics' => 
          array(
             'billed_charge_local_micro' => NULL,
             'billed_engagements' => NULL,
          ),
        ),
      ),
    ),
  ),
   'request' => 
  array(
     'params' => 
    array(
       'start_time' => '2019-01-31T22:00:00Z',
       'segmentation_type' => NULL,
       'entity_ids' => 
      array (
        0 => 'ivs1r',
      ),
       'end_time' => '2019-02-06T22:00:00Z',
       'country' => NULL,
       'placement' => 'ALL_ON_TWITTER',
       'granularity' => 'TOTAL',
       'entity' => 'FUNDING_INSTRUMENT',
       'platform' => NULL,
       'metric_groups' => 
      array (
        0 => 'BILLING',
      ),
    ),
  ),
)

As you can see, the API requests for both PUBLISHER_NETWORK and ALL_ON_TWITTER placements return null, but in the UI there is a spend of €0.02 for that period.

Thank you.


#5

@juanshishido?

Thank you.


#6

Hi, @majoritasdev. I just checked the UI and don’t see any spend for that FI. I also looked into the specific campaign that is showing the 221 impressions and the €0.02 spend in your screen shot, but I see it as all zeros for the specified date range. Are you still seeing spend through the UI?


#7

Ok. It seems I confused the dates. The API call was for the year 2019, and the UI selection for 2015. I won’t check, but I’m sure the API would return the €0.02 spend for that period in 2015.

Thank you, @juanshishido, for your help! :pray: