Skip to content

feat(builder): Google Analytics events for builder flows#375

Merged
pasevin merged 2 commits intomainfrom
feat/builder-ga-analytics-events
Mar 28, 2026
Merged

feat(builder): Google Analytics events for builder flows#375
pasevin merged 2 commits intomainfrom
feat/builder-ga-analytics-events

Conversation

@pasevin
Copy link
Copy Markdown
Collaborator

@pasevin pasevin commented Mar 28, 2026

Summary

Adds builder-specific Google Analytics (gtag) events via useBuilderAnalyticsuseAnalytics().trackEvent.

Events

Event When
transaction_executed Form preview: successful tx via TransactionForm onTransactionSuccess
contract_ui_created First IndexedDB persist of a new Contract UI (CREATE auto-save path only)
relayer_service_configured Relayer flow fully configured (service URL, API key, relayer selected)
uikit_changed User selects a UI kit in settings
address_book_opened Address book dialog opens

Dependencies

  • Bumps @openzeppelin/ui-renderer to ^1.2.0 and @openzeppelin/ui-types to ^1.13.0 (npm), aligned with openzeppelin-ui releases that add onTransactionSuccess.
  • Export versions.ts and snapshot updated by pre-push hook.

Tests

  • Extended useBuilderAnalytics.test.ts for new trackers.
  • UiKitSettings.test.tsx mocks updated for analytics hook.

Track transaction_executed via TransactionForm onTransactionSuccess,
contract_ui_created on first IndexedDB save, relayer_service_configured,
uikit_changed, and address_book_opened.

Bump @openzeppelin/ui-renderer to ^1.2.0 and @openzeppelin/ui-types to ^1.13.0.
@pasevin pasevin requested a review from a team as a code owner March 28, 2026 13:12
@pasevin pasevin requested a review from Copilot March 28, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds builder-specific Google Analytics event tracking for key builder flows by extending useBuilderAnalytics and wiring the new trackers into UI interactions (preview tx success, auto-save create, relayer configuration, UI kit changes, address book open). Also bumps OpenZeppelin UI package versions required for the new renderer callback and updates export version metadata/snapshots.

Changes:

  • Extend useBuilderAnalytics with new builder flow event helpers and add corresponding unit tests.
  • Emit analytics events from builder UI flows (auto-save create, relayer configured, UI kit selection, tx success in preview, address book open).
  • Bump @openzeppelin/ui-renderer / @openzeppelin/ui-types and update exported version metadata + snapshots.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks updated for @openzeppelin/ui-renderer/@openzeppelin/ui-types bump and related dependency graph changes.
apps/builder/src/hooks/useBuilderAnalytics.ts Adds builder-specific tracking helpers for the new GA events.
apps/builder/src/hooks/tests/useBuilderAnalytics.test.ts Extends hook tests to validate the new event helpers call trackEvent with expected payloads.
apps/builder/src/export/versions.ts Updates exported package version map for bumped UI packages.
apps/builder/src/export/tests/snapshots/ExportSnapshotTests.test.ts.snap Updates export snapshot expectations to reflect new dependency versions.
apps/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts Tracks contract_ui_created on CREATE auto-save path.
apps/builder/src/components/UIBuilder/StepFormCustomization/components/UiKitSettings.tsx Tracks uikit_changed when a user selects a UI kit.
apps/builder/src/components/UIBuilder/StepFormCustomization/components/RelayerConfiguration/index.tsx Tracks relayer_service_configured once the relayer flow is fully configured.
apps/builder/src/components/UIBuilder/StepFormCustomization/tests/UiKitSettings.test.tsx Updates mocks to include the analytics hook used by UiKitSettings.
apps/builder/src/components/UIBuilder/StepFormCustomization/FormPreview.tsx Wires transaction_executed tracking via TransactionForm’s onTransactionSuccess.
apps/builder/src/components/AddressBook/AddressBookDialog.tsx Tracks address_book_opened when the dialog opens.
apps/builder/package.json Bumps @openzeppelin/ui-renderer and @openzeppelin/ui-types dependency ranges.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts Outdated
Comment thread apps/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts Outdated
Comment thread apps/builder/src/components/UIBuilder/hooks/builder/useAutoSave.ts Outdated
Comment thread apps/builder/src/components/AddressBook/AddressBookDialog.tsx
Comment thread apps/builder/src/hooks/useBuilderAnalytics.ts
- Remove unused saveContractUI from useAutoSave deps
- Use 'unknown' for missing network/ecosystem dimensions on contract_ui_created
- Fire address_book_opened only on dialog open transition; stable dimensions
- Document new track* helpers with JSDoc
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pasevin pasevin merged commit 5e91e17 into main Mar 28, 2026
17 checks passed
@pasevin pasevin deleted the feat/builder-ga-analytics-events branch March 28, 2026 17:22
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