Time_series_length and the number of elements in the returned metrics are not matching


#1

Hi,

I am using V1 Ads API for Stats. I am facing some data discrepancies for a certain set of dates. Below are the 2 observations I want to share with you.

  1. I am giving same STATS calls, just for different sets of date ranges and every time, the data that I am getting back, is not consistent (Obviously, all the date ranges are having some common dates :slight_smile:).
  2. I also observed, the time_series_length and the number of elements in the returned metrics are not matching.

Below are the 3 different Jobs I initiated and received the files.
Job 1 - 773466530117853185
Job 2 - 773468909030690816
Job 3 - 773825384588521473

I guess, these Job IDs are enough to investigate it further. Let me know in case you need more information.


#3

Hi,

It’s expected that some data changes as described here:

All billing stats are generally final within 3 days of the event (~99%), however we do process some spam filtering for up to 14 days from the date of the event.

So it depends what inconsistency you are seeing. Please note that we had an issue where analytics was returning erroneous data a couple days ago, which has since been fixed so it would be worth confirming this behavior does not continue.

For the time_series_length, the job IDs are associated with your token so are difficult for us to investigate. If you can describe the problem in more detail it would be great.

Thanks,

John


#4

Thanks John for the response.

I will try to elaborate the 2 problems I have mentioned above.

  1.   I am giving some STATS calls for same set of Account and Campaigns. the only change is the date span that I am querying for. I am keeping the End Date same and just changing the start date. 
    

For better understandings, I am just sampling the data and sharing it for only 4 metrics ranging from 5th June to 11th June.

Data I am getting back for 15th May to 20th June

Date – Impressions – Engagements – Retweets – Replies
5-Jun-16 – 0 – 0 – 63 – 11
6-Jun-16 – 0 – 0 – 15 – 24
7-Jun-16 – 196170 – 1587 – 10 – 6
8-Jun-16 – 114436 – 980 – 13 – 5
9-Jun-16 – 85474 – 651 – 26 – 10
10-Jun-16 – 68572 – 686 – 0 – 0
11-Jun-16 – 184108 – 1566 – 0 – 0

From 19th May to 20th June. I am getting 0 Impressions and 0 Engagements for 9th June. Whereas for other dates all the Impressions and Engagements are in consecutive manner and there are no 0s in between.

Date – Impressions – Engagements – Retweets – Replies
5-Jun-16 – 0 – 0 – 63 – 11
6-Jun-16 – 196170 – 1587 – 15 – 24
7-Jun-16 – 114436 – 980 – 10 – 6
8-Jun-16 – 85474 – 651 – 0 – 0
9-Jun-16 – 0 – 0 – 13 – 5
10-Jun-16 – 68572 – 686 – 26 – 10
11-Jun-16 – 184108 – 1566 – 0 – 0

For 12th May to 20th June

Date – Impressions – Engagements – Retweets – Replies
5-Jun-16 – 0 – 0 – 0 – 0
6-Jun-16 – 196170 – 1587 – 63 – 11
7-Jun-16 – 114436 – 980 – 15 – 24
8-Jun-16 – 85474 – 651 – 10 – 6
9-Jun-16 – 68572 – 686 – 13 – 5
10-Jun-16 – 184108 – 1566 – 26 – 10
11-Jun-16 – 0 – 0 – 0 – 0

So in above 3 cases, you can see the data variations and there is one row for 9th June with 0 impressions and 0 engagements. Which is nowhere in between for the other 2 data sets.

  1.   My second query is related to the number of elements in each metric array for different dates. I am giving you the JSON I am getting back.
    

{“data_type”:“stats”,“time_series_length”:32,“data”:[{“id”:"",“id_data”:emphasized text[{“segment”:null,“metrics”:{“impressions”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196170,114436,85474,0,68572,184108,0,0,0,0,0,0,0,0,0,0,0,0],“tweets_send”:null,“billed_charge_local_micro”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381547000000,251492000000,152515000000,0,150825000000,406836000000,0,0,0,0,0,0,0,0,0,0,0,0],“qualified_impressions”:null,“follows”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,2,8,0,3,12,0,0,0,0,0,0,0,0,0,0,0],“app_clicks”:null,“retweets”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,15,10,0,13,26,0,0,0,0,0,0,0,0,0,0,0],“likes”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,57,46,0,29,85,0,0,0,0,0,0,0,0,0,0,0,0],“engagements”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1587,980,651,0,686,1566,0,0,0,0,0,0,0,0,0,0,0,0],“clicks”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,782,463,237,0,192,484,0,0,0,0,0,0,0,0,0,0,0],“card_engagements”:null,“replies”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,24,6,0,5,10,0,0,0,0,0,0,0,0,0,0,0],“url_clicks”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,53,22,0,35,50,0,0,0,0,0,0,0,0,0,0,0,0],“billed_engagements”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,822,565,373,0,398,874,0,0,0,0,0,0,0,0,0,0,0,0],“carousel_swipes”:null}}]}],“request”:{“params”:{“start_time”:“2016-05-19T04:00:00Z”,“segmentation_type”:null,“entity_ids”:[""],“end_time”:“2016-06-20T04:00:00Z”,“country”:null,“placement”:“ALL_ON_TWITTER”,“granularity”:“DAY”,“entity”:“CAMPAIGN”,“platform”:null,“metric_groups”:[“ENGAGEMENT”,“BILLING”]}}}_LLING"]}}}

Here you can see, I am querying for 19th May to 20th June (which is 32 days’ worth of data) and the time_series_length is also suggesting the same.
Since, the granularity is DAY, so I am expecting 1 metric element for a day and hence, all the metrics should return 32 elements but, this is clearly not the case and I am getting 36 elements for Impressions and Engagements and 34 for Retweets and Replies.

NOTE – I AM JUST GIVING AN EXAMPLE BY SHARING DATA FOR THESE 4 METRICS. I AM ACTUALLY GETTING THESE DISCREPANCIES FOR ALL THE METRICS USED.

Let me know if you need any more onformation on this.


#5

Hi,
Is there any update on this? Is the above mentioned problem is clear or need more details?


#6

Hi I haven’t been able to follow up about this thread yet - so I can attempt to repro it would actually help if you can provide a twurl command for creating the async result you are seeing a variation of time_series_length for. For example something like:

twurl -H ads-api.twitter.com “/1/stats/jobs/accounts/18ce521zerv” -X POST -d “entity_ids=50ZZY&entity=CAMPAIGN&start_time=2016-05-26&end_time=2016-06-01&granularity=TOTAL&metric_groups=MOBILE_CONVERSION&placement=ALL_ON_TWITTER” | jsonpretty

It shouldn’t be a problem to expose an account ID or campaign ID but if you feel more comfortable with DM or whispering it feel free to do so.

In general, the only known issue around time_series_length is that if there is no data to return we don’t return a value at all (instead returning just a null) instead of returning 36 zeroes and wasting space, but I don’t really expect to see the problem you are describing…

Thanks,

John


#7

I’m running across the same issue. Times Series says 89, but I am getting 98 values per metric.

https://ads-api.twitter.com/1/stats/jobs/accounts/18ce53v3bxo?entity=account&granularity=day&start_time=2017-01-12&end_time=2017-04-11&entity_ids=18ce53v3bxo&metric_groups=billing,engagement,life_time_value_mobile_conversion,media,mobile_conversion,video,web_conversion&placement=all_on_twitter&job_ids=852268914562281472

The Downloaded report looks like:

{  
  "data_type":"stats",
  "time_series_length":89,
  "data":[  
    {  
      "id":"18ce53v3bxo",
      "id_data":[  
        {  
          "segment":null,
          "metrics":{  
            "impressions":[  
              9598,
              7959,
              6876,
              6260,
              12443,
              11765,
              6232,
              6071,
              7259,
              5451,
              0,
              4319,
              47524,
              34923,
              25212,
              17664,
              58015,
              14127,
              10429,
              30849,
              13790,
              0,
              5579,
              11247,
              9453,
              6404,
              4955,
              32010,
              6364,
              5821,
              6416,
              2091,
              0,
              1735,
              3130,
              19432,
              99108,
              47069,
              38144,
              65755,
              50323,
              53033,
              98450,
              0,
              64353,
              61624,
              59214,
              53146,
              50299,
              45484,
              89134,
              50257,
              66144,
              59813,
              0,
              63825,
              52374,
              51387,
              54227,
              57790,
              144662,
              58679,
              64941,
              49057,
              52109,
              0,
              93581,
              70942,
              77373,
              48794,
              35928,
              34553,
              38582,
              43208,
              44215,
              47046,
              0,
              50095,
              52528,
              38352,
              46353,
              79918,
              70036,
              80272,
              91380,
              110643,
              66615,
              0,
              55765,
              65296,
              32428,
              37801,
              38035,
              38878,
              25885,
              22550,
              29110,
              0
            ],
            "follows":[  
              2,
              1,
              1,
              0,
              4,
              1,
              1,
              0,
              1,
              0,
              0,
              0,
              5,
              2,
              2,
              2,
              2,
              1,
              0,
              4,
              0,
              0,
              0,
              2,
              0,
              0,
              2,
              5,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              3,
              1,
              2,
              4,
              0,
              0,
              0,
              2,
              0,
              0,
              4,
              6,
              1,
              1,
              1,
              0,
              1,
              0,
              2,
              2,
              1,
              1,
              3,
              3,
              0,
              3,
              0,
              3,
              3,
              3,
              2,
              1,
              1,
              0,
              0,
              4,
              2,
              0,
              3,
              1,
              1,
              1,
              2,
              3,
              1,
              1,
              1,
              5,
              0,
              0,
              1,
              2,
              0,
              1,
              1,
              1,
              0,
              0,
              0
            ],
            "retweets":[  
              2,
              0,
              1,
              1,
              2,
              2,
              0,
              1,
              0,
              1,
              0,
              0,
              6,
              5,
              3,
              2,
              2,
              0,
              0,
              4,
              3,
              0,
              0,
              1,
              3,
              2,
              1,
              4,
              2,
              1,
              0,
              1,
              0,
              1,
              1,
              3,
              8,
              3,
              2,
              5,
              1,
              1,
              6,
              0,
              2,
              2,
              7,
              2,
              2,
              4,
              8,
              4,
              6,
              4,
              0,
              3,
              3,
              3,
              3,
              0,
              10,
              4,
              2,
              1,
              0,
              0,
              3,
              4,
              4,
              4,
              2,
              2,
              0,
              2,
              0,
              1,
              0,
              2,
              0,
              1,
              0,
              2,
              3,
              0,
              4,
              5,
              1,
              0,
              3,
              3,
              0,
              1,
              1,
              2,
              1,
              0,
              1,
              0
            ],
            "likes":[  
              28,
              22,
              13,
              19,
              33,
              19,
              10,
              12,
              15,
              10,
              0,
              12,
              58,
              55,
              64,
              45,
              75,
              27,
              25,
              36,
              46,
              0,
              1,
              24,
              28,
              32,
              12,
              50,
              32,
              16,
              26,
              12,
              0,
              8,
              10,
              48,
              63,
              54,
              35,
              86,
              48,
              44,
              133,
              0,
              73,
              50,
              71,
              54,
              42,
              47,
              110,
              49,
              60,
              55,
              0,
              49,
              51,
              53,
              43,
              32,
              88,
              65,
              36,
              39,
              41,
              0,
              114,
              52,
              62,
              66,
              28,
              20,
              30,
              63,
              40,
              42,
              0,
              38,
              22,
              17,
              22,
              63,
              58,
              37,
              87,
              80,
              86,
              0,
              60,
              50,
              27,
              32,
              33,
              29,
              22,
              8,
              23,
              0
            ],
            "engagements":[  
              394,
              322,
              234,
              325,
              702,
              381,
              209,
              231,
              226,
              207,
              0,
              223,
              1294,
              650,
              694,
              632,
              1797,
              520,
              406,
              1228,
              560,
              0,
              41,
              395,
              434,
              371,
              383,
              1312,
              323,
              201,
              261,
              49,
              0,
              31,
              40,
              704,
              593,
              502,
              243,
              845,
              489,
              576,
              1778,
              0,
              688,
              580,
              613,
              527,
              466,
              461,
              1454,
              513,
              926,
              729,
              0,
              776,
              618,
              699,
              612,
              623,
              821,
              886,
              753,
              702,
              877,
              0,
              1452,
              873,
              783,
              872,
              594,
              482,
              612,
              717,
              585,
              653,
              0,
              537,
              417,
              323,
              440,
              841,
              598,
              572,
              732,
              841,
              959,
              0,
              846,
              898,
              352,
              403,
              437,
              451,
              293,
              269,
              360,
              0
            ],
            "replies":[  
              0,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              7,
              5,
              0,
              0,
              1,
              1,
              0,
              6,
              2,
              0,
              2,
              1,
              1,
              0,
              0,
              0,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              3,
              1,
              0,
              0,
              1,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              5,
              0,
              3,
              0,
              0,
              0,
              0,
              1,
              1,
              1,
              0,
              0,
              1,
              0,
              0,
              0,
              1,
              2,
              0,
              0,
              0,
              1,
              0,
              0,
              0,
              1,
              0,
              0,
              0,
              0,
              0,
              1,
              0,
              2,
              0,
              1,
              0,
              0,
              1,
              2,
              1,
              0,
              0,
              0,
              0,
              0,
              0,
              0
            ]
          }
        }
      ]
    }
  ],
  "request":{  
    "params":{  
      "start_time":"2017-01-11T21:00:00Z",
      "segmentation_type":null,
      "entity_ids":null,
      "end_time":"2017-04-10T21:00:00Z",
      "country":null,
      "placement":"ALL_ON_TWITTER",
      "granularity":"DAY",
      "entity":"ACCOUNT",
      "platform":null,
      "metric_groups":[  
        "BILLING",
        "ENGAGEMENT",
        "LIFE_TIME_VALUE_MOBILE_CONVERSION",
        "MEDIA",
        "MOBILE_CONVERSION",
        "VIDEO",
        "WEB_CONVERSION"
      ]
    }
  }
}

I am asking for 89 days of data and getting back 98 values per metric, should I disregard any metric values after 89th value or is this a bug that needs to be fixed?


#8

Thanks for this information, @1kon1k. It looks like there are nine 0s in the response arrays. We’ll investigate further.


#9

@juanshishido Any updates to this issue?


#10

Thanks for the follow up, @1kon1k! Haven’t had a chance to find the root cause on this one yet. By the way, have you seen this happen on any other requests?