Performance by Url



Our team at Gupta Media is trying to build a report based on the url that the creatives are driving to.

For instance it would be nice to see the cost, clicks, and impressions for each url a campaign is trying to drive traffic towards.

Our current plan to achieve something like this is as follows:

  1. call accounts/:account_id/line_items to get all of the line items in the account.
    a. Filter these line items by their campaign_id in order to find the line items in these campaigns (additionally you can provide up to 50 campaign ids in the parameters of the line items call)
  2. call accounts/:account_id/promoted_tweets to get the promoted tweets in the account
    be sure to add the parameter with_deleted=true to retrieve the previously deleted tweets
    a. Filter these promoted tweets by their line_item_id in (additionally you can provide a single line_item_id in the parameters of the promoted tweets call to get promoted tweets in that line item)
  3. with the promoted tweets that you now have, you have to call the public twitter api (not ads, to get the tweet information
    a. twurl -t /1.1/statuses/show.json?id=693960543493816322
    b. the id is the tweet_id on the promoted tweet object
    c. the url of this tweet is under entities → urls → expanded_url
  4. call stats/accounts/:account_id/promoted_tweets to get the stats for each of these urls
    you can only provide 20 promoted_tweet_ids to this call

The problem where this method will fail is that a promoted tweet can have multiple urls. So we will not be able to breakdown the stats from the promoted tweet level to the individual url

Is there a better way to obtain this information?


@guptamedia you are definitely taking the correct approach here to get from tweet to expanded_url and then to the stats for the associated promoted tweet. Unfortunately, we don’t currently provide stats at a lower level of creative than the promoted tweet and the situation you called out with multiple expanded_url entires could definitely be a problem for you.

The only viable (but less than optimal) work arounds for this that are available would be:

  1. To restrict the contents of the promoted tweets you’re working with to only one URL.
  2. To leverage your own URL wrapper / shortener (eg. to track URL level analytics.

Twitter does wrap all the URLs in every tweet in our own URL shortener for spam control, abuse and a few other purposes, but unfortunately we don’t expose any of the analytics for interactions with those URLs. You would need to use your own URL shortener if you needed analytics at a lower level than the promoted tweet.