@abletest/able 中文文档教程
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
Cloudflare
ACCOUNT_ID
- 单击您的应用程序,这些位于您要测试的站点的右下方栏 Cloudflare
ZONE_ID
against将您的 Cloudflare 页面设置为部署所有分支以预览分支(默认)
TO USE
npm i -g @abletest/able
(可能必须使用sudo
)如果使用 UMAMI 仪表板:
- Run
cdk bootsrap aws://${AWS_ACCOUNT_NUMBER}/'us-east-1'
(this must use us-east-1 region)
可设置
- Umami 服务器基础设施的设置(如果选择)大约需要 20-25 分钟。able config
- 这将生成一个名为ableConfig.json
的文件,您将在其中填写拆分测试配置。 如果您使用的是 Umami 仪表板,请使用admin
和umami
登录并在settings->add website
下设置您的目的地并复制脚本标签到ableConfig.json
文件中的适当变体。 小心将单引号嵌套在双引号内,反之亦然;)创建测试分支并将其推送到 github 和 Cloudflare,它们将部署到预览分支。 输入这些 URLS,这些 URLS 将与分支名称相匹配 连同 Cloudflare 页面站点名称; 即,
test.mysite.pages.dev
,进入ableConfig.json
文件。able deploy
将拆分测试部署到 Cloudflare。 这大约需要 5-10 秒。
TO UPDATE
更改
ableConfig.json
文件able update
以将这些更改推送到 Cloudflare。 他们将在几秒钟内上线。
TO TEARDOWN
able destroy-test
从 Cloudflare 中删除分割测试。able destroy-umami
来拆除 Umami 服务器。 此过程大约需要 25-30 分钟。
TO RUN NEW TESTS
将带有测试的新代码推送到您的仓库 & Cloudflare 页面站点
使用新的控件和变体名称编辑 Umami 仪表板并复制 scipt 标签
使用新的控件和测试变体路径更新
ableConfig.json
文件的variants
部分和脚本运行
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 globallynpm
installedHave handy your
Cloudflare
EMAIL
Cloudflare
GLOBAL API_KEY
- Found underProfile->API Tokens
Cloudflare
ACCOUNT_ID
- Click on your application and these are found on the lower right sidebarCloudflare
ZONE_ID
for the site you will be testing againstHave your Cloudflare Pages set to deploy all branches to preview branches (the default)
TO USE
npm i -g @abletest/able
(may have to usesudo
)IF USING UMAMI DASHBOARD:
- Run
cdk bootsrap aws://${AWS_ACCOUNT_NUMBER}/'us-east-1'
(this must use us-east-1 region)
able setup
- Setup of Umami server infrastructure (if selected) takes approximately 20-25 minutes.able config
- This will generate a file calledableConfig.json
that you will fill in with your split test configurations. If you are using the Umami Dashboard, log in usingadmin
andumami
and set up your destinations there undersettings->add website
and copy the script tags into the appropriate variants in theableConfig.json
file. Be careful to nest your single quotes inside your double quotes and not vice-versa ;)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 theableConfig.json
file.able deploy
to deploy the split test to Cloudflare. This will take approximately 5-10 seconds.
TO UPDATE
Make changes to the
ableConfig.json
fileable update
to push those changes to Cloudflare. They will be live in a few seconds.
TO TEARDOWN
able destroy-test
to remove split test from Cloudflare.able destroy-umami
to teardown Umami server. This process takes approximately 25-30 minutes.
TO RUN NEW TESTS
Push new code with tests to your repo & Cloudflare pages site
Edit your Umami dashboard with new control and variant names and copy the scipt tags
Update the
variants
section of theableConfig.json
file with the new control and test variant paths and scriptsRun the
able update
command