Discrepancy in Stats in WebUI and APIs

ads
analytics
promoted-tweets

#1

Hi,

We are seeing discrepancies in statistics reported on twitter ads analytics WEBUI and the statistics returned by APIs (stats for promoted_tweets) . Difference is approximately 6%. Is this normal?

Here are the stats from API for placement = ALL_ON_TWITTER

twurl -H ads-api.twitter.com "/2/stats/accounts/18ce53uxjpy?entity=PROMOTED_TWEET&entity_ids=1jrlnc,1jkf91&start_time=2017-11-01T00:00:00Z&end_time=2017-11-07T00:00:00Z&granularity=TOTAL&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT,BILLING" | python -m json.tool

Here are the stats from API for placement = PUBLISHED_NETWORK

twurl -H ads-api.twitter.com "/2/stats/accounts/18ce53uxjpy?entity=PROMOTED_TWEET&entity_ids=1jrlnc,1jkf91&start_time=2017-11-01T00:00:00Z&end_time=2017-11-07T00:00:00Z&granularity=TOTAL&placement=PUBLISHER_NETWORK&metric_groups=ENGAGEMENT,BILLING" | python -m json.tool

and here are the stats on on WEBUI -

I have tried with additional one day plus end_date as 11/08/2017 instead of 11/07/2017. But statistics still dont add up. Can anyone please help?

Thank you
@Pushkr


#2

Hi @Pushkr,

The issue here is with the timezone on your API request. This “2017-11-01T00:00:00Z” is at 12AM UTC, since our data is all stored in UTC. The timezone on the ads account is in EST which is currently UTC + 5. If you leave off “T00:00:00Z” from the API request it will use the ads account timezone.

If you’d like to match your API request to the UI, it would be the following: (note start time is UTC +4 because it was before DST ended)

$ twurl -H ads-api.twitter.com "/2/stats/accounts/18ce53uxjpy?entity=PROMOTED_TWEET&entity_ids=1jrlnc,1jkf91&start_time=2017-11-01T04:00:00Z&end_time=2017-11-07T05:00:00Z&granularity=TOTAL&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT,BILLING" | jq
{
  "data_type": "stats",
  "time_series_length": 1,
  "data": [
    {
      "id": "1jrlnc",
      "id_data": [
        {
          "segment": null,
          "metrics": {
            "impressions": [
              217632
            ],
            "tweets_send": [
              10
            ],
            "billed_charge_local_micro": [
              1962306747
            ],
            "qualified_impressions": null,
            "follows": [
              20
            ],
            "app_clicks": null,
            "retweets": [
              158
            ],
            "likes": [
              1003
            ],
            "engagements": [
              4801
            ],
            "clicks": [
              3676
            ],
            "card_engagements": null,
            "poll_card_vote": null,
            "replies": [
              56
            ],
            "url_clicks": [
              1236
            ],
            "billed_engagements": [
              3185
            ],
            "carousel_swipes": null
          }
        }
      ]
    },
    {
      "id": "1jkf91",
      "id_data": [
        {
          "segment": null,
          "metrics": {
            "impressions": [
              71548
            ],
            "tweets_send": [
              9
            ],
            "billed_charge_local_micro": [
              737693253
            ],
            "qualified_impressions": null,
            "follows": [
              6
            ],
            "app_clicks": null,
            "retweets": [
              104
            ],
            "likes": [
              547
            ],
            "engagements": [
              1907
            ],
            "clicks": [
              1468
            ],
            "card_engagements": null,
            "poll_card_vote": null,
            "replies": [
              43
            ],
            "url_clicks": [
              389
            ],
            "billed_engagements": [
              1305
            ],
            "carousel_swipes": null
          }
        }
      ]
    }
  ],
  "request": {
    "params": {
      "start_time": "2017-11-01T04:00:00Z",
      "segmentation_type": null,
      "entity_ids": [
        "1jrlnc",
        "1jkf91"
      ],
      "end_time": "2017-11-07T05:00:00Z",
      "country": null,
      "placement": "ALL_ON_TWITTER",
      "granularity": "TOTAL",
      "entity": "PROMOTED_TWEET",
      "platform": null,
      "metric_groups": [
        "ENGAGEMENT",
        "BILLING"
      ]
    }
  }
}

Ads UI - 11/1 - 11/6 = 11/1 - 11/7 in API:

2017-12-11_2053