[wordpress插件] AB Testing with Javascript使用Java进行AB测试

wordpress 插件 文章 2020-01-24 02:20 613 0 全屏看文

AI助手支持GPT4.0

评分

0

0

描述

A plugin for A/B split-testing HTML/CSS/DOM elements with javascript.

一个用于使用JavaScript对A / B进行HTML / CSS / DOM元素拆分测试的插件。

WordPress, JQuery, and Google Analytics are required to run experiments.

进行实验需要WordPress,JQuery和Google Analytics(分析)。

Important: This plugin is probably best suited for developers with advanced JavaScript and theme development skills.

重要:此插件可能最适合具有高级JavaScript和主题开发技能的开发人员。

It’s not overly complex, but if you’re not experienced with manipulating the DOM with JS, you probably won’t find this plugin useful.

并不太复杂,但是如果您没有使用JS操作DOM的经验,那么您可能会发现此插件没有用。

    • Test changes to your site with Javascript
    • 使用JavaScript测试对您网站的更改

    • Run up to 5 tests simultaneously (per visitor session)
    • (每次访问者会话)最多同时运行5个测试

    • Unlimited versions per test
    • 每个测试的无限版本

    • Test info is saved in cookies so returning visitors see the same version of your site
    • 测试信息保存在cookie中,因此回头客可以看到您网站的相同版本

    • Experiment data is sent to your google analytics account as custom variables
    • 实验数据作为自定义变量发送到您的Google Analytics(分析)帐户

    • No AJAX.

    • 没有AJAX。

      Test info and javascript code are served from static ab.js file

    • 测试信息和javascript代码是从静态 ab.js 文件提供的

    • Experiment info/data is saved in the wordpress table wp_options
    • 实验信息/数据保存在wordpress表 wp_options

    Supports both versions of Google Analytics, old “_gaq” and new Universal “ga()”

    支持两种版本的Google Analytics(分析),旧的“ _gaq”和新的通用“ ga()”

    If you have Universal Analytics deployed on your site, you must

    如果您在网站上部署了通用分析,则必须

    provide a Custom Dimension key.

    提供自定义维度键

    Follow these instructions to setup a custom dimension.

    按照这些说明设置自定义维度。

    Then, eadd the dimension to the plugin settings.

    然后,将尺寸添加到插件设置中。

    Also, Universal Analytics users must use this (Custom Report)[https://www.google.com/analytics/web/template?uid=-O_F9EH4Qpil1mSt9l6U8A] to view test results (Universal Analytics only).

    此外,Universal Analytics用户还必须使用此(自定义报告)[https://www.google.com/analytics/web/template?uid=-O_F9EH4Qpil1mSt9l6U8A]来查看测试结果(仅适用于Universal Analytics)。

    >

    >

    You can help to contribute to this project on github.com @ WordPress AB Testing

    您可以在github.com @ WordPress AB测试上为该项目做出贡献。

    Requirements

    要求

      • General WordPress Installation
      • 常规WordPress安装

      • Google Analytics
      • Google Analytics(分析)

      • jQuery – available to your wp-admin and client side
      • jQuery –可用于您的wp-admin和客户端

      • ability to set file and folder permissions on your server
      • 可以在服务器上设置文件和文件夹权限

      • Do not run more than 5 A/B tests per visitor session.

      • 每个访问者会话运行的A / B测试不要超过5个。

        Otherwise analytics data will be overwritten or lost

      • 否则分析数据将被覆盖或丢失

      • Cache control of file js/ab.js.

      • 文件 js / ab.js 的缓存控制。

        This file is rewritten and updated often, so make sure you can update cached versions of this file.

      • 该文件经常被重写和更新,因此请确保您可以更新此文件的缓存版本。

      Javascript

      Javascript

        • After your first test is created, you must globally link to the plugin file js/ab.js in your wordpress theme.
        • 创建第一个测试后,您必须全局链接到wordpress主题中的插件文件 js / ab.js

        • This plugin does not load any external libraries.
        • 此插件不会加载任何外部库。

        • jQuery Cookie is included in the js/ab.js<

        • jQuery Cookie 包含在 js / ab.js <

          /code> file.

        • / code>文件。

        • You must load jQuery in your wordpress theme to support the jQuery Cookie library.
        • 您必须在wordpress主题中加载 jQuery 才能支持jQuery Cookie库。

        • You can load and use any other javascript library you require for your theme and use that library in your A/B tests to manipulate DOM elements during tests.
        • 您可以加载和使用主题所需的任何其他JavaScript库,并在A / B测试中使用该库在测试过程中操作DOM元素。

        Google Analytics

        Google Analytics(分析)

          • This plugin uses google analytics to store test data.
          • 此插件使用Google Analytics(分析)存储测试数据。

          • Data stored is Test Name and Test Version
          • 存储的数据为测试名称和测试版本

          • The combination of Test Name and one Test Version Name must be less than 128 characters.

          • 测试名称和一个测试版本名称的组合必须少于128个字符。

            Otherwise _setCustomVar() will not except all data.

          • 否则, _setCustomVar()不会除外所有数据。

          • _setCustomVar() is called just before firing _trackEvent() to store test data.
          • 在触发 _trackEvent()存储测试数据之前,调用

          • _setCustomVar()

          • Custom Variable applied to track event _gaq.push(['_setCustomVar', 'Slot', 'AB: ' + 'Test Name', 'Version Name', 2]); Slot =

          • 自定义变量,用于跟踪事件 _gaq.push(['_ setCustomVar','Slo​​t','AB:'+'Test Name','Version Name',2]); Slot =

            Test Index

          • 测试索引

          • Event sent _gaq.push(['_trackEvent', 'AB Testing', 'Test View', 'Test Name & Version']);
          • 事件已发送 _gaq.push(['_ trackEvent','AB Testing','Test View','Test Name&Version']);

          • Goals: It is up to you, the webmaster or analytics admin, to set the test goals in your analytics admin settings.
          • 目标:网站管理员或分析管理员应自行决定在分析管理员设置中设置测试目标。

          • Do not run more than 5 A/B tests per visitor session.

          • 每个访问者会话运行的A / B测试不要超过5个。

            Otherwise analytics data will be overwritten or lost

          • 否则分析数据将被覆盖或丢失

          Supports both versions of Google Analytics, old “_gaq” and new Universal “ga()”

          支持两种版本的Google Analytics(分析),旧的“ _gaq”和新的通用“ ga()”

          If you have Universal Analytics deployed on your site, you must

          如果您在网站上部署了通用分析,则必须

          provide a Custom Dimension key.

          提供自定义维度键

          Follow these instructions to setup a custom dimension.

          按照这些说明设置自定义维度。

          Then, eadd the dimension to the plugin settings.

          然后,将尺寸添加到插件设置中。

          Also, Universal Analytics users must use this (Custom Report)[https://www.google.com/analytics/web/template?uid=-O_F9EH4Qpil1mSt9l6U8A] to view test results (Universal Analytics only).

          此外,Universal Analytics用户还必须使用此(自定义报告)[https://www.google.com/analytics/web/template?uid=-O_F9EH4Qpil1mSt9l6U8A]来查看测试结果(仅适用于Universal Analytics)。

          >

          >

          Here's further reading about Google Analytics Custom Variables,

          此处进一步介绍了Google Analytics(分析)自定义变量

          ="https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide" rel="nofollow">Analytics Events, and Analytics Goals.

          / analytics / answer / 1032415?hl = zh_CN“ rel =” nofollow“>分析目标。

          When a visitor views a page with a given test running, we use “Session Level” events to track the test view, because this ensures the test data will carry through the session to the conversion goal.

          当访问者在运行给定测试的情况下查看页面时,我们将使用“会话级别”事件来跟踪测试视图,因为这可以确保测试数据将整个会话带入转换目标。

          From what I understand, “Page Level” custom variables will not work because we are firing an event after page load.

          据我了解,“页面级”自定义变量将不起作用,因为我们在页面加载后触发了一个事件。

          Therefore, because the event is fired in the middle of a session, we must use session level custom variables Read More Here

          “ rel =” nofollow“>在此处了解更多信息

          A/B Split Test

          A / B拆分测试

            • All A/B tests are run by manipulating HTML/CSS DOM elements in your wordpress theme with javascript.
            • 所有A / B测试都是通过使用javascript处理wordpress主题中的HTML / CSS DOM元素来运行的。

            • Depending on how many versions you are testing, all site traffic will be split evenly to show each test version.
            • 根据要测试的版本数,所有站点访问量将平均分配以显示每个测试版本。

            • When a test version is run, the javascript you defined in the plugin admin will execute and show that variation to the user.
            • 运行测试版本时,您将在插件管理中定义的javascript执行并向用户显示该版本。

            • No Server-Side scripting is used.
            • 不使用服务器端脚本。

            • Any javascript library can be used in your A/B Test, given that you have loaded the library in your wordpress theme.
            • 假设您已将JavaScript库加载到wordpress主题中,则可以在A / B测试中使用任何javascript库。

            Running An A/B Split Test

            运行A / B拆分测试

            After you have installed the plugin, in the wordpress admin, navigate to AB Testing and click Create New Test.

            安装插件后,在wordpress管理员中,导航至 AB Testing ,然后单击 Create New Test

            Enter Test Name, each test Version’s Name, and enter your custom javascript in Version Code and click Save Test.

            输入测试名称,每个测试版本的名称,然后在版本代码中输入您的自定义JavaScript,然后点击保存测试

            Be sure to include your analytics=true flag in all of your test version code snippets.

            确保在所有测试版本代码段中都包含 analytics = true 标志。

            The combination of Test Name and one Test Version Name must be less than 128 characters.

            测试名称和一个测试版本名称的组合必须少于128个字符。

            This is because _setCustomVar limits character length.

            这是因为 _setCustomVar 限制了字符长度。

            Make sure your server /js/ directory and file /js/ab.js have permissions 0755 or 0775 so PHP can write output to the ab.

            请确保您的服务器 / js / 目录和文件 /js/ab.js 的权限为0755或0775,以便PHP可以将输出写入 ab。

            js file.

            js 文件。

            When you are ready to start your test, click the checkbox Active, which will write your new test to the js/ab.js file and make your test live

            准备开始测试时,请单击复选框 Active ,这会将您的新测试写入 js / ab.js 文件并使测试生效

            to your site visitors.

            给您的网站访问者。

            And don’t forget to update any cached versions of js/ab.js.

            并且不要忘记更新 js / ab.js 的任何缓存版本。

            Example Test Version Code

            示例测试版本代码

            First, decide what elements in your theme HTML you want to test.

            首先,确定主题HTML中要测试的元素。

            Because your js/ab.js file is included globally into your theme, your A/B test code will manipulate any DOM elements that meet its conditions.

            因为您的 js / ab.js 文件是全局包含在主题中的,所以您的A / B测试代码将操纵符合其条件的所有DOM元素。

            Therefore, do not run tests on general elements like

            or from green to orange.

            这是我们测试将

安装步骤

    • Copy the files from this repo to your server directory /wp-content/plugins/
    • 将文件从此存储库复制到服务器目录 / wp-content / plugins /

    • In wp-admin, navigate to Plugins and activate ‘A/B Split Testing’
    • 在wp-admin中,导航至“插件”并激活“ A / B拆分测试”

    • set server /js/ directory permissions to 0755 or 0775. Directory must be writable by PHP
    • 将服务器 / js / 的目录权限设置为0755或0775。该目录必须可由PHP写入

    • set server /js/ab.js file permissions to 0755 or 0775. File must be writable by PHP
    • 将服务器 /js/ab.js 的文件权限设置为0755或0775。该文件必须可由PHP写入

    • link to the file /js/ab.js in the header of every page on your website

    • 链接到网站上每个页面标题中的文件 /js/ab.js

    • Make sure to clear any cache for the /js/ab.js file after starting, updating, or stopping tests.
    • 确保在开始,更新或停止测试之后清除 /js/ab.js 文件的所有缓存。

下载地址

https://downloads.wordpress.org/plugin/ab-testing-with-javascript.zip

https://downloads.wordpress.org/plugin/ab-testing-with-javascript.zip

-EOF-

AI助手支持GPT4.0