Skip to content

feat(analytics): name the app so the first page view is attributed - #32

Merged
vpetersson-bot merged 1 commit into
masterfrom
feat/attribute-first-pageview
Aug 15, 2026
Merged

feat(analytics): name the app so the first page view is attributed#32
vpetersson-bot merged 1 commit into
masterfrom
feat/attribute-first-pageview

Conversation

@vpetersson-bot

Copy link
Copy Markdown
Contributor

Bumps @screenly-labs/signage-kit to 2026.8.9 and passes the app name to playerProfileResponse, 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.

Why

trackPlayer does not run until after DOMContentLoaded, but the automatic page_view goes out with the config call in the <head>. So the first page view under any client_id carried 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:

vendor users sessions events page views
yodeck 150 150 150 0
brightsign 913 922 3

Fleet-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

  • Opt-in in the kit: without app the payload is unchanged, so this is the only line needed here.
  • The capability fields are still set by trackPlayer a moment later, since they need a DOM to probe. User properties are last-write-wins, so the richer set supersedes.
  • Does not touch the client_id churn 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

`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>
@vpetersson-bot
vpetersson-bot merged commit 0bb7541 into master Aug 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant