Show TikTok post metrics on the post screen - #363
Merged
Merged
Conversation
added 8 commits
September 18, 2026 12:08
…PI, MCP and the editor.
…me-caption repost is never claimed.
…t values() instead.
… file with regex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PostMetricsFetcherso the post show card can load views, likes, comments, and shares viaPOST /v2/video/query/.publicaly_available_post_id(common afterPUBLISH_COMPLETE), match the video onvideo/listby caption and persist the numeric id +/video/{id}URL — at publish time for public posts, and again when metrics load.PUBLIC_TO_EVERYONE,MUTUAL_FOLLOW_FRIENDS,FOLLOWER_OF_CREATOR,SELF_ONLY) in aPrivacyLevelenum across web, API, MCP and the editor.SELF_ONLY+ branded content is rejected everywhere.SELF_ONLYis never looked up onvideo/list.Test plan
Publish only to TikTok (other networks just add noise). Use a unique caption each time so the
video/listmatch cannot grab an older post. After each publish, wait until the card ispublished, then open the post show screen.1. Editor — privacy + branded (no publish needed)
2. Publish matrix
Do these 6 posts. Comments / Duet / Stitch / AI / auto-music do not change analytics — flip them once on the first video and first carousel so the payload still goes through, then leave them.
tiktok.com/@user/video/{id}, not the profile./video/{id}only if TikTok exposes a public id — empty card + profile link is OK. Page must not error./video/{id}(photo posts also get an item id). Auto add music = yes on this one.Then one branded publish (TikTok forbids Private + branded, already covered in §1):
/video/{id}like fix: correct Google OAuth config key in token refresh #1.3. Show screen / cache
platform_urlto/video/{id}and then show metrics. Reload once if the first paint was empty.unsupportedcache.4. Automated
php artisan test --compact tests/Feature/Services/Social/TikTokAnalyticsTest.php tests/Feature/Services/Social/TikTokPublisherTest.php tests/Unit/Enums/TikTok/PrivacyLevelTest.php tests/Feature/Services/Social/TikTokCreatorInfoTest.php