最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

What is the simplest way to get the creation time for different assets for Facebook Ads? - Stack Overflow

programmeradmin2浏览0评论

My goal is to associate all running ad id's with the creation time of the underlying asset. I think that this is the only way I can do it:

  1. Request all ad_ids running in an account
  2. For each ad id, get the creative id
  3. For each creative_id, get the object_story_spec or effective_object_story_id (for ads which are made from an existing post) 4a. Video ads, use the AdVideo with the asset ID
video = AdVideo(api=api, fbid=asset_id)
            video.api_get(
                fields=['created_time', 'updated_time'],
                batch=batch,
                success=partial(callback, asset_id=asset_id)
            )

4b. Image ads: use the image hash to get the AdImage

            image = AdImage(api=api, fbid=asset_id)
            image.api_get(
                fields=['created_time', 'updated_time', 'id'],
                batch=batch,
                success=partial(callback, asset_id=asset_id)
            )

4c. For existing posts, use the Post API and get a long lived token like described here:

Use the graph tool to generate an access token Generate a long lived user token ;client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-user-access-token} Generate a long lived page token /<PAGE_ID>?fields=access_token&access_token=<LONG_LIVED_USER_TOKEN> Use that long lived page token to connect to the api From there, we have the ad_id and the creation date of the underlying asset, all with batches. I'm sure I'm over-complicating things though!

发布评论

评论列表(0)

  1. 暂无评论