@abletest/able 中文文档教程

发布于 3年前 浏览 27 项目主页 更新于 3年前

ABLE A/B TESTING FOR CLOUDFLARE APPLICATIONS WITH UMAMI ANALYTICS DASHBOARD

这是给谁的?

在 Cloudflare 上托管 JAMStack 应用程序并想要运行拆分测试的人。 我们提供使用您自己的分析服务(例如 Google Analytics)的选项,或者我们 可以为您部署一个 Umami Web 服务器到 AWS 基础设施,它将在您的自定义域名下使用 ECS 和 RDS,url ableumami.yoursite.whatever,并且 在大约 30-40 分钟内,您将拥有一个完全可操作的拆分测试,其中包含用于您自己的自定义事件的漂亮且信息丰富的仪表板!

PREREQUISITES

  • 如果使用 UMAMI 仪表板:

  • 在本地计算机上配置的 AWS 帐户和凭据

  • aws-cdk 全局安装

  • npm 准备

  • 好您的

  • Cloudflare EMAIL

  • Cloudflare GLOBAL API_KEY - 位于 Profile->API Tokens

    Screenshot of API key location!

  • Cloudflare ACCOUNT_ID - 单击您的应用程序,这些位于

  • 您要测试的站点的右下方栏 Cloudflare ZONE_ID against

    账号ID区截图!

  • 将您的 Cloudflare 页面设置为部署所有分支以预览分支(默认)

TO USE

  1. npm i -g @abletest/able (可能必须使用 sudo

  2. 如果使用 UMAMI 仪表板:

  • Run cdk bootsrap aws://${AWS_ACCOUNT_NUMBER}/'us-east-1' (this must use us-east-1 region)
  1. 可设置 - Umami 服务器基础设施的设置(如果选择)大约需要 20-25 分钟。

  2. able config - 这将生成一个名为 ableConfig.json 的文件,您将在其中填写拆分测试配置。 如果您使用的是 Umami 仪表板,请使用 adminumami 登录并在 settings->add website 下设置您的目的地并复制脚本标签到 ableConfig.json 文件中的适当变体。 小心将单引号嵌套在双引号内,反之亦然;)

  3. 创建测试分支并将其推送到 github 和 Cloudflare,它们将部署到预览分支。 输入这些 URLS,这些 URLS 将与分支名称相匹配 连同 Cloudflare 页面站点名称; 即,test.mysite.pages.dev,进入 ableConfig.json 文件。

  4. able deploy 将拆分测试部署到 Cloudflare。 这大约需要 5-10 秒。

TO UPDATE

  1. 更改 ableConfig.json 文件

  2. able update 以将这些更改推送到 Cloudflare。 他们将在几秒钟内上线。

TO TEARDOWN

  1. able destroy-test 从 Cloudflare 中删除分割测试。

  2. able destroy-umami 来拆除 Umami 服务器。 此过程大约需要 25-30 分钟。

TO RUN NEW TESTS

  1. 将带有测试的新代码推送到您的仓库 & Cloudflare 页面站点

  2. 使用新的控件和变体名称编辑 Umami 仪表板并复制 scipt 标签

  3. 使用新的控件和测试变体路径更新 ableConfig.json 文件的 variants 部分和脚本

  4. 运行 able update 命令

ABLE A/B TESTING FOR CLOUDFLARE APPLICATIONS WITH UMAMI ANALYTICS DASHBOARD

Who is this for?

Someone who is hosting a JAMStack application on Cloudflare and wants to run a split test. We offer the option to use your own analytics service like Google Analytics, or we can deploy an Umami Webserver to AWS infrastructure for you which will use ECS and RDS under your custom domain name with the url ableumami.yoursite.whatever, and in about 30-40 minutes you will have a fully operational split test with a beautiful and informative dashboard for your own custom events!

PREREQUISITES

  • IF USING UMAMI DASHBOARD:

  • AWS account and credentials configured on local machine

  • aws-cdk installed globally

  • npm installed

  • Have handy your

  • Cloudflare EMAIL

  • Cloudflare GLOBAL API_KEY - Found under Profile->API Tokens

    Screenshot of API key location!

  • Cloudflare ACCOUNT_ID - Click on your application and these are found on the lower right sidebar

  • Cloudflare ZONE_ID for the site you will be testing against

    Screenshot of Account ID area!

  • Have your Cloudflare Pages set to deploy all branches to preview branches (the default)

TO USE

  1. npm i -g @abletest/able (may have to use sudo)

  2. IF USING UMAMI DASHBOARD:

  • Run cdk bootsrap aws://${AWS_ACCOUNT_NUMBER}/'us-east-1' (this must use us-east-1 region)
  1. able setup - Setup of Umami server infrastructure (if selected) takes approximately 20-25 minutes.

  2. able config - This will generate a file called ableConfig.json that you will fill in with your split test configurations. If you are using the Umami Dashboard, log in using admin and umami and set up your destinations there under settings->add website and copy the script tags into the appropriate variants in the ableConfig.json file. Be careful to nest your single quotes inside your double quotes and not vice-versa ;)

  3. Create and push your test branches to github and Cloudflare where they will be deployed to preview branches. Enter these URLS, which are going to match the branch name along with the Cloudflare pages site name; ie, test.mysite.pages.dev, into the ableConfig.json file.

  4. able deploy to deploy the split test to Cloudflare. This will take approximately 5-10 seconds.

TO UPDATE

  1. Make changes to the ableConfig.json file

  2. able update to push those changes to Cloudflare. They will be live in a few seconds.

TO TEARDOWN

  1. able destroy-test to remove split test from Cloudflare.

  2. able destroy-umami to teardown Umami server. This process takes approximately 25-30 minutes.

TO RUN NEW TESTS

  1. Push new code with tests to your repo & Cloudflare pages site

  2. Edit your Umami dashboard with new control and variant names and copy the scipt tags

  3. Update the variants section of the ableConfig.json file with the new control and test variant paths and scripts

  4. Run the able update command

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文