Tracking post performance
get_analytics is the single entry point for post metrics, with three relevant dimensions:
- dimension 'post' with an id (the post URN, like 'urn:li:activity:1234') returns metrics for one specific post. This is a live lookup with a cache in front of it.
- dimension 'posts' returns aggregate daily posting stats. Aggregates are served from a nightly cache that is 1 to 23 hours old; pass refresh true to force a recompute when you need current numbers.
- dimension 'content' returns a content dashboard overview of your publishing activity.
All of them take a period of 'day', 'week', or 'month', and return empty slices when there is no data yet.
For ranking your recent posts, use get_cached_post_analytics. It returns impressions, reactions, comments, reposts, and engagement rate per post, sortable by any of those dimensions and filterable by content type. It serves cached data with a live fallback. One honesty note: its comments count reflects LinkedIn's total including replies, so it runs higher than the top-level count you get from list_post_comments.
list_posts in top mode does the same ranking job when you want the posts themselves: it ranks your own posts by impressions, reactions, comments, reposts, or engagement rate over a lookback window.
A useful weekly loop: pull your top posts by engagement rate, look at what the winners have in common, and feed that into next week's drafts. The content patterns article covers the tool that automates exactly that analysis.