Skip to content

Conversation

@dinosoeren
Copy link
Collaborator

@dinosoeren dinosoeren commented Oct 29, 2025

Note

Adds analytics click tracking (GENERIC_CLICK) with StashAnalytics and StashSDK, a coroutine runner, a sample usage script, and README documentation.

  • Core:
    • StashAnalytics: send GENERIC_CLICK events to /sdk/event/log_event (env-aware endpoints), including device/build metadata and optional params; manual JSON payload shaping.
    • CoroutineRunner: singleton MonoBehaviour to run coroutines from non-MonoBehaviour code.
    • StashSDK: initialization and TrackClick API plus getters and init check, delegating to StashAnalytics via CoroutineRunner.
  • Samples:
    • Stash.Samples/ClickTrackingExample: demonstrates initialization and multiple click-tracking scenarios (basic, custom data, navigation, etc.).
  • Docs:
    • README.md: adds Event Tracking usage examples and updates components table to include analytics.

Written by Cursor Bugbot for commit 7ee143a. This will update automatically on new commits. Configure here.

Copy link
Collaborator Author

dinosoeren commented Oct 29, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dinosoeren dinosoeren marked this pull request as ready for review October 29, 2025 19:34
else
{
value = kvp.Value.ToString();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: JSON Serialization Fails Due to Locale Formatting

The ConvertDictionaryToJson method's manual serialization can produce malformed JSON. It uses locale-dependent formatting for numeric values and inserts other object types unquoted, causing API requests to fail.

Fix in Cursor Fix in Web

void OnShopButtonClick()
{
// Track the click with just element ID and screen name
StashSDK.TrackClick("shop_button", "main_menu");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huda-stash let's make this even more generic StashSDK.TrackEvent("event_id", "event_type", "event_target", "screen_name")

e.g. StashSDK.TrackEvent("click_pay", "CLICK", "buy_button", "main_menu")

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.

2 participants