How Does Nelio A/B Testing Work with Staging and Live (Testing/Production) Environments?

Nelio A/B Testing works seamlessly with staging and production environments. You can create or modify your tests in a staging site and then move them to your live site without having to recreate them.


How Nelio Identifies Your Site

When you activate Nelio A/B Testing for the first time, the plugin obtains a unique Site ID (nab_site_id) and Secret Key (nab_api_secret) from Nelio’s Cloud. These credentials:

  • Identify your website in our Cloud
  • Are stored in your WordPress database (wp_options)
  • Link events from your visitors with your site
  • Are linked to your subscription license

Your tests and variants themselves are stored in your WordPress database, while all tracking data (views, conversions, heatmaps…) is stored in Nelio Cloud.


How Staging/Live detection works

By default, Nelio A/B Testing assumes your staging site is a database copy of your live site and therefore shares the same Site ID and Secret Key.

Nelio detects a staging environment automatically:

  • It checks the return type of wp_get_environment_type. If it’s anything other than production, it assumes it’s a staging environment.
  • If the home URL contains the word “staging”, it treats the site as a staging site. For instance, https://staging.neliosoftware.com is a staging site.
  • Otherwise, Nelio considers it a live site.

Does Nelio track events in staging?

No. Nelio A/B Testing does not send tracking events to Nelio Cloud when your site is detected as staging.

Instead, you can use Nelio A/B Testing’s Debug Tools to see what’s happening on the page, including the tests and variants involved and the events that would normally be tracked.

This allows you to validate your test configuration safely before going live without affecting your real test data or consuming quota.

🔍 For more information, see Using the Debug Tools.


Moving tests from Staging to Live

Because tests, variants, and their settings are stored in your WordPress database, they can be moved from staging to production along with your WordPress data.

If your staging and live environments share the same Site ID and Secret Key, Nelio A/B Testing recognizes them as the same site. Once the tests are available on the live site, tracking events can be sent to Nelio Cloud as usual.