Skip to content

Analytics: include LinkedIn (pages now, personal profile after r_member_postAnalytics) #377

Description

@paulocastellano

LinkedIn and LinkedIn Pages are excluded from Analytics on purpose (Platform::isIncludedInAnalytics(), app/Enums/SocialAccount/Platform.php:43-50), so no publications, follower snapshots or post metrics are collected for them, and imported LinkedIn posts don't show up in Sent.

Target card (per post): reactions, comments, engagement rate, impressions, reach (+ reposts and clicks where available).

  • LinkedIn Pages: use organizationalEntityShareStatistics (impressionCount, uniqueImpressionsCount → reach, clickCount, likeCount, commentCount, shareCount, engagement). The current page scopes should be enough — confirm against config('trypost.platforms.linkedin-page.scopes').
  • Personal profile: Member Post Analytics API (memberCreatorPostAnalytics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE) needs r_member_postAnalytics from the Community Management API product. Request access on the LinkedIn app first; add the scope to config('trypost.platforms.linkedin.scopes') only after it is approved (an unapproved scope breaks the consent screen for every connect/reconnect). Existing accounts must reconnect to grant it.
  • Enable LinkedIn / LinkedInPage in isIncludedInAnalytics(), implement discovery + metrics in LinkedInAnalytics / LinkedInPageAnalytics, and add the per-network metric set in resources/js publicationMetrics.ts.
  • Tests with Http::fake (official payloads), PostgreSQL + MySQL.

Docs: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions