feat(analytics): name the app so the first page view is attributed - #32
Merged
Conversation
`playerProfileResponse` now takes the app name, which adds a ready-made
`userProperties` object to the `/api/player` payload. The inline bootstrap sets it
before `gtag('config')` fires the automatic `page_view`.
Without it that page view goes out ahead of `trackPlayer`, which does not run until
after DOMContentLoaded, so it carries no player fields. Where the client_id survives
the loss is invisible, because every later page view is attributed. Where the id is
minted fresh on every load, no page view is ever attributed: `player_vendor=yodeck`
measured 150 users and zero page views on 2026-08-14, and 21% of app runs fleet-wide
carried no player fields.
Kit bumped to 2026.8.9, which adds the option.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Bumps
@screenly-labs/signage-kitto2026.8.9and passes the app name toplayerProfileResponse, which adds a ready-madeuserPropertiesobject to the/api/playerpayload. The inline bootstrap sets it beforegtag('config')fires the automaticpage_view.Why
trackPlayerdoes not run until afterDOMContentLoaded, but the automaticpage_viewgoes out with theconfigcall in the<head>. So the first page view under anyclient_idcarried no player fields.Where the id survives the loss is invisible, because every later page view is attributed. Where the id is minted fresh on every load, no page view is ever attributed. GA4 on 2026-08-14:
yodeckbrightsignFleet-wide 21% of app runs carried no player fields (13.6% on the worker apps, 66.9% on the static ones), biased against exactly the high-churn players a census most needs to see.
Notes
appthe payload is unchanged, so this is the only line needed here.trackPlayera moment later, since they need a DOM to probe. User properties are last-write-wins, so the richer set supersedes.client_idchurn itself. Only the device id fixes that, and it is gated on the per-asset "Send metadata" switch.Kit side: Screenly-Labs/signage-kit#32
🤖 Generated with Claude Code