How to tell if Promoted Tweet is currently active?

ads
api

#1

I am trying to determine how to definitively determine that a single Promoted Tweet is currently active (aka being shown and distributed) at a given moment. I want to determine this in order to know whether or not I should make an API call to get updated metrics from the stats endpoint.

There doesn’t seem to be a live field that is returned from any endpoints that shows this. Is the following logic sound?

If a Promoted Tweet:
a) is not deleted
b) if its line item is not deleted
c) if its line item is not paused
d) if the campaign start date is after the current time
e) if the campaign end date is before the current time
f) if its campaign is not paused
g) if its campaign is not deleted

then it is live. otherwise, it is not currently live.

Is this logic sound? Am I missing anything?

Thank you!


Get Ads Data Daily - only for campaigns running on a given date
#2

That looks pretty good to me - the one thing you can also check is whether or not servable field is true, this field will generally be set to false by the system when we determine there is some factor needing to stop the campaign (for example, the funding instrument was suddenly frozen or account was blocked for spam). The paused field would probably also be set in those cases but it wouldn’t hurt to check both things if you really want to create a “running” status filter.


#3

@JBabichJapan ah, yes, we’re actually also using REASONS_NOT_SERVABLE in the check, I just forgot to include it in my original post :smile:

thanks for the response!

I don’t necessarily love the idea of keeping track of a running or currently_live state for all promoted tweets within our system, but at the same time, it seems very wasteful to continue making calls to get updated statistics for promoted tweets that aren’t even currently running.

on the other hand, in this implementation, we will have to make additional calls to periodically check on the status of the promoted tweets, line items, and campaigns, since users can pause and unpause campaigns, etc, which means a previously-“dead” promoted tweet can be brought back to life.

is there a canonical or recommended way (or any general advice) to build such a system - one that keeps up-to-date statistics on promoted tweets?

again, thanks!


#4

@obscyuriy: you should also stop checking for report updates for a promoted tweet that is not live, after some time (I use 7 days, to be sure), since the metrics can be updated after a promoted tweet was paused / deleted.


#5

thanks @majoritasdev , very good to know! do you use a similar kind of logic to determine that the promoted tweet is no longer live?


#6

Yes, I do. :slight_smile: