Historical Data - Ads API


#1

Hi @juanshishido, Is there any possibility to retrieve all historical campaign data? For example data from one year old till date through any API(Ads API or any other API).


#2

This is not possible.


#3

Hey @deansharedemo

Just wanted to update this thread. You should be able to pull historical campaign/line item level stats from the async analytics endpoint.

Hope that helps!


#4

Hi @juanshishido and @imit8me , I am confuse with below result

Request Parameters

Array
 (
   [end_time] => 2017-04-03
   [entity] => CAMPAIGN
   [entity_ids] => 7xaoi
   [granularity] => DAY
   [metric_groups] => ENGAGEMENT
   [placement] => ALL_ON_TWITTER
  [start_time] => 2017-03-28
)  

Response from API

stdClass Object
(
[data_type] => stats
[time_series_length] => 6
[data] => Array
    (
        [0] => stdClass Object
            (
                [id] => 7xaoi
                [id_data] => Array
                    (
                        [0] => stdClass Object
                            (
                                [segment] => 
                                [metrics] => stdClass Object
                                    (
                                        [impressions] => Array
                                            (
                                                [0] => 1011
                                                [1] => 0
                                                [2] => 0
                                                [3] => 0
                                                [4] => 0
                                                [5] => 0
                                            )

                                        [tweets_send] => 
                                        [qualified_impressions] => 
                                        [follows] => 
                                        [app_clicks] => 
                                        [retweets] => 
                                        [likes] => 
                                        [engagements] => Array
                                            (
                                                [0] => 17
                                                [1] => 0
                                                [2] => 0
                                                [3] => 0
                                                [4] => 0
                                                [5] => 0
                                            )

                                        [clicks] => Array
                                            (
                                                [0] => 17
                                                [1] => 0
                                                [2] => 0
                                                [3] => 0
                                                [4] => 0
                                                [5] => 0
                                            )

                                        [card_engagements] => 
                                        [replies] => 
                                        [url_clicks] => Array
                                            (
                                                [0] => 6
                                                [1] => 0
                                                [2] => 0
                                                [3] => 0
                                                [4] => 0
                                                [5] => 0
                                            )

                                        [carousel_swipes] => 
                                    )

                            )

                    )

            )

    )

[request] => stdClass Object
    (
        [params] => stdClass Object
            (
                [start_time] => 2017-03-27T23:00:00Z
                [segmentation_type] => 
                [entity_ids] => Array
                    (
                        [0] => 7xaoi
                    )

                [end_time] => 2017-04-02T23:00:00Z
                [country] => 
                [placement] => ALL_ON_TWITTER
                [granularity] => DAY
                [entity] => CAMPAIGN
                [platform] => 
                [metric_groups] => Array
                    (
                        [0] => ENGAGEMENT
                    )

            )

    )

)

Issue are below

1. There is mismatch between Request Parameters(Above)  and Request Parameters Returning in API response.

2.There is showing 6 day(time_series_length=6) between date 2017-03-28(YYYY-MM-DD) to 2017-04-03(YYYY-MM-DD). I think, time_series_length should be 7 between date 2017-03-28(YYYY-MM-DD) to 2017-04-03(YYYY-MM-DD).

3. I am sending start time 2017-03-28(YYYY-MM-DD) but the API response it showing 2017-03-27(YYYY-MM-DD)

How the gap are showing between Request Parameters(Which are sending from my side) and Request Parameters Returning in API response?


#5

1.There is mismatch between Request Parameters(Above) and Request Parameters Returning in API response.

Please provide the complete request (make sure to include account ID) so that we can try to reproduce it on our end.

2.There is showing 6 day(time_series_length=6) between date 2017-03-28(YYYY-MM-DD) to > 2017-04-03(YYYY-MM-DD). I think, time_series_length should be 7 between date 2017-03-28(YYYY-MM-DD) to 2017-04-03(YYYY-MM-DD).

Please note that start_time and end_time values must correspond to midnight in the account’s timezone, relative to UTC. Input values that omit the timestamp, such as 2017-03-28, will be automatically translated to the appropriate UTC value unless you take the extra step of specify the exact hour (e.g. 2017-03-28T14:00:00Z).

3.I am sending start time 2017-03-28(YYYY-MM-DD) but the API response it showing 2017-03-27(YYYY-MM-DD)

The answer to your question relates to our previous comment. Please change the start/end time accordingly and please remember that the start and end dates are exclusive, meaning that if you specify start date as 2017-03-28 the response will not include
2017-03-28 data.