feat: report attempts to use locked assets (locked_asset_clicked) [Better data collection] - #2301
Open
PetrDlouhy wants to merge 2 commits into
Open
feat: report attempts to use locked assets (locked_asset_clicked) [Better data collection]#2301PetrDlouhy wants to merge 2 commits into
PetrDlouhy wants to merge 2 commits into
Conversation
The unlock links' UTM tags only see users who reach the browser; who tried a locked asset and walked away was invisible, and the server never sees the encounter because the add-on gates on canDownload before any request. This event fires at the three places a locked asset is acted on - both drag-and-drop upsell dialogs and the detail panel's unlock button - with the asset ids, the surface and the popup copy variant, so the encounters share one vocabulary with the UTM click-throughs and the unlock-copy A/B test finally has a denominator. Asset ids are sent on purpose: they make locked assets comparable by demand (anonymous machines included, joinable to an account once it signs in through the stable system_id) and let the web side follow up on real interest. The detail panel gets its own operator instead of a branch in the generic wm.blenderkit_url. report_event now honours the "Send usage data" preference (the Client drops it too, bk_client#53); the preference text says exactly what the switch covers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The panel referenced the module without importing it, which the new operator test exposed (the draw path itself has no test). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## claude/save-presence #2301 +/- ##
========================================================
+ Coverage 34.10% 34.26% +0.15%
========================================================
Files 87 88 +1
Lines 27527 27583 +56
========================================================
+ Hits 9388 9450 +62
+ Misses 18139 18133 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Why
The unlock links' UTM tags (#2243) only see users who reach the browser. A user who drags a locked asset, sees "Unlock all assets" and closes the dialog was invisible — and the server never sees the encounter, because the add-on gates on
canDownloadbefore making any request. Conversion rates need the denominator; the per-asset demand signal ("which locked assets do people try?") did not exist at all.What
locked_asset_clickedwith{asset_base_id, asset_id, asset_type, placement, variant}at the three seams where a locked asset is acted on:addon_purchase_dragasset_unlock_drag(+ popup copyvariant)asset_unlock_panel(+variant)Same vocabulary as the UTM tags, so encounters and click-throughs join — and the unlock-copy A/B test (
support/now/join) finally has a per-variant denominator instead of click-through counts only.Asset ids are sent deliberately (decision with Petr): they make locked assets comparable by demand even for anonymous machines, which become attributable once the machine signs in (stable
system_id), and they let the server-side interest mail show the actual assets. Consumed by Blendkit-server'slocked_assets_interestflow.Design
unlock_options.report_locked_asset_click, three callers.wm.blenderkit_unlock_assetoperator (reports, then opens the tagged URL) rather than anifinside the genericwm.blenderkit_url— the same SRP point agajdosi raised on this PR's base.client_lib.report_eventreturns early when "Send usage data" is off — the add-on side of the rule that everything on/report_eventis optional; the Client drops it as well (bk_client#53).download.usage_reports_enablednow delegates to the same read.Tests
test_unlock_options.py(payload, missing keys),TestReportEvent.test_opted_out_sends_nothing(+ the preference pinned in the existing tests),TestUnlockAssetOperator(reports then opens the tagged URL; empty variant omitted). The drag-op branches are exercised only through the shared helper — the drag operator itself has no unit harness.Stack
Stacked on #2296 (
claude/save-presence): needs its preference and releases with it. Client side: bk_client#52 → bk_client#53.🤖 Generated with Claude Code