canonical / ubuntu.com

The official website for the Ubuntu operating system
https://ubuntu.com
Other
185 stars 189 forks source link

WD-11695 - redirect users to different takeovers #13990

Closed lizzochek closed 1 day ago

lizzochek commented 1 week ago

Done

Added switching between 2 takeover types for different user groups. PUT SWITCH TO FALSE BEFORE MERGE

QA

Screenshot 2024-06-27 at 10 40 23

Issue / Card

WD-11695

webteam-app commented 1 week ago

Demo

Jenkins

demos.haus

petesfrench commented 1 week ago

@lizzochek Can you add some more details to the QA steps please ie. what each type is supposed to look like

petesfrench commented 1 week ago

It isn't switching for me based on the cookie: image image

lizzochek commented 1 week ago

currently on demo it does change correctly for me. Please make sure to reload the page. And the current takeover style is. also in black - maybe that is also confusing. The new one is ONLY 'A CTO's guide...', all other ones are from current page

Screenshot 2024-06-27 at 11 49 55 Screenshot 2024-06-27 at 11 50 17
petesfrench commented 1 week ago

Hey, the problem is still persisting, here we have a 'control' takeover, while the cookie is set to 'variant'. The reason for this is because the check for the cookie type is done server-side, before the JS has run. You need to move the takeover rendering into some JS that runs after the JS responsible for assigning the control/variant cookie. image EDIT: I believe this is how they are doing it on ubuntu.com, see https://github.com/canonical/ubuntu.com/blob/c289f51b28223d39ebc713c104301fefd075ce4b/templates/base_index.html#L1096 If this can't work here you might have to generate two different formats and only show the appropriate one.

akbarkz commented 6 days ago

@lizzochek Why when the cookie value is set to "variant" I'm only seeing one takeover. It is supposed to show different takeovers but with a different layout.

lizzochek commented 2 days ago

@akbarkz as far as I understood from our discussion, for the test template we are not fetching the data from discourse, therefore there is one takeover. do we need to show all the same takeovers as the 'control' option?

akbarkz commented 2 days ago

@lizzochek I think you understood it wrong then. We need to show only one different layout. But the takeovers content should remain the same. Meaning they should still change but show with a different layout.