- I have two variations of a component, Promo and AmazingPromo.
- I've created a page and set up personalisation to show one or the other based on a condition (for instance if the user is from the UK they see AmazingPromo).
- I've created a component test to see which one performs better in relation to a goal in Sitecore. (50% UK users see Promo, 50% of UK users see AmazingPromo, and all other users see Promo)
This works great and I can see test data/results in Sitecore.
However, many prefer to use Google for their analytics and I'd like to push events through the GTM datalayer only when a test is running for the user.
So is it possible to do the following:
- Not from UK: No Event Pushed
- From UK, Test Renders Promo: Event 'Control' Pushed
- From UK, Test Renders AmazingPromo: Event 'Variant' Pushed
Currently I've added the push script to each component, but this means that is is called when the test isn't running (i.e. for non UK users) and this distorts the results in GA.