This article applies to Nelio A/B testing versions prior to 5.0.

If you are looking for documentation for our newest version, please bookmark

Nelio A/B Testing uses two JavaScript files for tracking your visitors and showing the appropriate (original or alternative) content:

  • Information about your running experiments (a script served by Nelio Cloud).
  • Nelio's Tracking JavaScript, served by your server (called tracking.min.js)

tracking.min.js is a static JavaScript file included in our plugin which depends on the first script and some data from your WordPress site. This data is inserted in the resulting page using a WordPress function named wp_localize_script. As you can read in the Codexthis function "can be used to make any data available to your script that you can normally only get from the server side of WordPress". When using that information, the resulting HTML code looks similar to the following:

<script type="text/javascript" src=""></script>

<script type="text/javascript">NelioABParams = { /* ... */ };</script>

<script type="text/javascript" src=".../tracking.min.js"></script>

If you use a WordPress minification plugin (such as Better WordPress Minify or WP Minify), you'll have to make sure that the first and second scripts appear before the third one. If one of them appears after the minified version of tracking.min.js, Nelio A/B Testing won't work. If that were the case, make sure you exclude it from the minification process. In particular, exclude the entry called nelioab_tracking_script.