Skip to content

Conversation

@tyiuhc
Copy link
Collaborator

@tyiuhc tyiuhc commented Dec 18, 2025

Summary

Support analytics_event page trigger, fired when a event is tracked with matching:

  1. event_type
  2. event_properties

This will require either:

  1. the web experiment plugin to be added to the Amplitude Analytics SDK, or;
  2. trackEvent to be called when a relevant event is fired.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@macroscopeapp
Copy link

macroscopeapp bot commented Dec 18, 2025

Add analytics_event trigger by emitting bus events from DefaultWebExperimentClient.trackEvent and an Amplitude enrichment plugin in experiment.ts

Introduce DefaultWebExperimentClient.trackEvent to publish analytics_event messages and add an Amplitude enrichment plugin that forwards SDK events to the message bus; update SubscriptionManager.isPageObjectActive to evaluate conditions for analytics_event with URL, name, and properties; adjust event property typing to Record<string, unknown>.

📍Where to Start

Start with the plugin and trackEvent implementations in experiment.ts, then review SubscriptionManager.isPageObjectActive in subscriptions.ts for trigger evaluation.


📊 Macroscope summarized 5a2960e. 3 files reviewed, 2 issues evaluated, 2 issues filtered, 0 comments posted. View details

@promptless
Copy link

promptless bot commented Dec 18, 2025

📝 Documentation updates detected!

Updated existing suggestion: Document new page trigger types for Web Experiment

@tyiuhc tyiuhc requested a review from a team December 19, 2025 00:26
Comment on lines +463 to +464
// Event type already matched above, conditions evaluated
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just want to double check: Shouldn't it check the trigger value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All the event-related + URL targeting conditions should be within conditions in PageObject.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you elaborate? My understanding of conditions is that it only refers to the URL page targeting rules and not events.

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.

3 participants