use amp-experiment to affect amp-story-page-outlink's link and text
Description
Request
We've started using amp-experiment in order to learn what clients react best to and wanted to test different story-page-outlink's text and links based on amp-experiment.
Simplified use case: My story's CTA is leading to my site in which the user can subscribe to something I'm offering. I want to test what is more effective - the outlink leading to our home page VS the outlink leading to our pricing page. In addition I would like to test if a "Check us out" would get more clicks than a "See pricing".
Complexities:
- The outlinks leads to a website I don't control - e.g. a client's website. I control my clients' stories and want to offer them the best possible outcomes. For that I want to try different things and would like to keep my experiments as part of my stories.
- The text I want to put on the CTA need to correspond with the outlink's url - meaning that even if I use one URL in the middle to redirect to a different URL under my control I wont be able to show the fitting text on the story.
Why it can't be achived at the moment We can't use more than one "amp-story-page-outlink" tag or more than one "a" tag inside it, so we can't use some styling tricks in order to hide all but one amp-story-page-outlink like: body[amp-x-myExp="testOne"] amp-story-page-outlink#cta2-2, body[amp-x-myExp="testOne"] amp-story-page-outlink#cta2-3, body[amp-x-myExp="testOne"] amp-story-page-outlink#cta2-4, body[amp-x-myExp="testOne"] amp-story-page-outlink#cta2-5 { visibility: hidden }
Alternatives Considered
Using amp-experiment with styling solutions are not possible as specified in the request. Using a single URL to manage redirects between several options is not a good enough solution as specified in the request.
Additional Context
I've sent a message in amp-story slack channel to see if there's an existing solution and found out there is none.
Someone named Matias Szylkowski said "I imagine there could be an API that could support these types of features (specifically by changing this selector you could select one or another tag based on the experiment ID)."
I took a look on the referenced code and it sure does look like a really good solution to allow switching between "a" tags depending on experiment ID like he suggested.
cc/ @ampproject/wg-stories
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.