Repository navigation
Conversation
Adds a ButtonClicks autocapture group, off by default, that sends button_clicked with the button's name and type when a Unity UI or UI Toolkit button is pressed. The label text is never read. It follows the group switch, minimum consent, session sampling and per session cap like the other groups, and a game that sends the same name by hand gets the existing name clash warning once the group is on. The uGUI and UI Toolkit hooks are separate assemblies that only compile when that package or module is in the project, so a project with neither still builds. The sample project now lists com.unity.ugui so CI compiles the uGUI half on every platform and Unity version. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Audience SDK — Build Size
SDK Size = build minus empty app. Change = vs baseline. Fails if any platform exceeds its absolute size limit. |
A generic button name such as Back repeats across screens, so button_clicked now also carries scene_name, the same key the scene events use. A uGUI button reports the scene of its GameObject and a UI Toolkit button the scene of its UIDocument. A button kept with DontDestroyOnLoad reports the active scene, since that pseudo-scene says nothing, and the property is left out when the name is empty. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Menu and button clicks show how players move through a game, and many studios hand write them. They are also the easiest way to flood the product with events, so this is opt-in and uses the same switches, caps, sampling and consent as the other automatic events.
What studios get
button_clickedelement_id(the button's name),element_type(alwaysbutton),scene_name(the scene the button is in)button_clicked,element_idandelement_typeare the names the web SDK and the event catalog already use, so one chart reads both. The web SDK also sends the label asbutton_text. This one never does. The scene tells apart generic names such asBackthat repeat across screens, and uses the same key as the scene events. A button kept withDontDestroyOnLoadreports the active scene, because that pseudo-scene says nothing.Set
AudienceConfig.Autocapture.ButtonClicks.Enabled = trueto switch it on. It is off by default. Up to 50 events per session and a sampling rate, like the other groups, and Anonymous consent or higher.How it stays safe
button_clickeditself gets the existing one-time warning once the group is on.How buttons are found
nameis skipped, because the click would say nothing about which button it wasonClick, added at Init and on each scene load, including inactive buttons in closed panelsTesting
main. 22 of the new tests drive real uGUI buttons and real UI Toolkit events, including a scene loaded on top of another and a canvas kept across scenes.com.unity.ugui, so CI compiles the uGUI half for every platform and Unity version. Unity 6 upgrades it to 2.0.0 by itself.🤖 Generated with Claude Code