Is A/B testing in AWS for static websites not possible using Cloudfront?
Asked Answered
R

1

10

I've provisioned the following AWS resources to host a static website (via Cloudformation):

  • S3 bucket to store the website
  • Cloudfront distribution for CDN (for reduced latency)
  • Route 53 A record sets that directs traffic to the CDN

I have two completely different websites that I'd like to A/B test to see traffic behavior and conversions. Is it possible to configure A/B testing using the resources that I've configured?

This is what I've tried so far.

Bringing up the same Cloudformation stack for the second website doesn't work cause Cloudfront only allows a single distribution to have a particular CNAME. For example if my website is example.com, only one Cloudfront distribution can have that CNAME configured to it.

If I try to use the existing Cloudfront distribution there doesn't seem to be a way to split traffic to the two different websites hosted in different S3 buckets. Within the Cloudfront distribution I need to create a second origin and then a behavior. The behavior requires a path + precedence so all the traffic will get sent to one of the websites but not the other.

Is it not possible to configure A/B testing of static websites hosted in S3 with Cloudfront?

Regenerative answered 25/7, 2017 at 13:32 Comment(0)
C
8

You can use a Lambda@Edge function to manipulate the request and then serve a different page using CloudFront.

A/B Testing example:

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-examples.html#lambda-examples-a-b-testing

Cricket answered 25/7, 2017 at 16:48 Comment(1)
Interesting. Thanks for the link I'll take a look!Regenerative

© 2022 - 2024 — McMap. All rights reserved.