simorgh icon indicating copy to clipboard operation
simorgh copied to clipboard

Change Optimizely's Click and View Events To Be Unique To Components

Open HarveyPeachey opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Optimizely events are agnostic to which experiments have fired them, this means that if multiple experiments are running on the page at the same time, and fire the same events, they would track the events for all experiments that have that metric enabled in the Optimizely UI. For example, if the high impact promos and the Hindi recommendations experiment are running at the same time on an article page, a component_click event that gets fired from the high impact promo, will be registered for both experiments in Optimizely results.

We're unsure if there is a feature within Optimizley's SDK that can associate fired events with certain experiments, as we can't find anything documented that points to this functionality.

Describe the solution you'd like In the click and view tracker, we should change the component_clicks and component_views, to make use of the passed in componentName const, which will append to the start of the event name e.g features_clicks, features_views. This will make events unique to components, and would mean these events will need to be created within Optimizely as well.

https://github.com/bbc/simorgh/blob/e8d935f08cbaddffd251f91bf2cbb7b0f824be13/src/app/hooks/useClickTrackerHandler/index.jsx#L61-L72

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Testing notes [Tester to complete]

Dev insight: Will Cypress tests be required or are unit tests sufficient? Will there be any potential regression? etc

  • [ ] This feature is expected to need manual testing.

Checklist

Additional context Add any other context or screenshots about the feature request here.

HarveyPeachey avatar Feb 22 '22 14:02 HarveyPeachey