How to test and roll out web tracking

Prev Next

Environments and rollout practices help you validate web tracking changes safely before they affect production. They reduce the risk of breaking live pages, sending incorrect data to destinations, or creating noise in reporting.

The Data Activation platform supports separating behavior by environment. A common configuration is to have at least:

  • Test: For validating changes before rollout to production.

  • Production: For live data collection.

With both environments, you can:

  • Test changes without affecting production tracking and audiences.

  • Validate page structure and properties before rollout.

  • Prevent test data from leaking into live marketing tools.

If you don't explicitly set an environment, the default is production.

_st('setEnvironment', 'test');

Before you begin

Make sure that you have the following details ready before testing and rolling out web tracking:

  • Access to a test environment in the platform.

  • Ability to deploy changes to a staging or test site.

  • You have defined which pages and flows to test.

Instructions

Step 1: Set up environment separation

Configure your implementation to use environments:

  1. Set the environment to test on staging or test sites.

  2. Keep the environment as production (or unset) on live sites.

  3. Verify that test and production data appear separately in the platform.

See our articles on how to set up web tracking or how to capture server-side events.

Step 2: Validate page structure coverage

Before focusing on destinations, confirm that page structures are being sent correctly for real user flows. Verify the page structure under Tags → Pages.

Test these pages at a minimum:

  • Homepage

  • Category or search results

  • Product details

  • Checkout steps (cart, payment, confirmation)

  • Account and login pages

The goal is to confirm that the tracking accurately reflects the customer journey.

Step 3: Validate required properties

Confirm that the properties needed for your first use cases are arriving correctly on the Data activation dashboard and under Data → Engagements:

  • Locale or market identifiers

  • Product or content IDs

  • Customer identifiers (when available)

Start with the minimum set needed for 1-2 high-value use cases. Avoid trying to capture everything at once.

Step 4: Validate tag loading

Confirm that tags load only where needed:

  • Check that page-specific tags load on the correct pages.

  • Verify that no unexpected tags are loading.

  • Monitor page performance to catch regressions.

Step 5: Roll out to production in stages

Roll out changes incrementally to reduce the chance of broad production issues:

  1. Start with a limited set of pages or traffic segments.

  2. Monitor performance and data quality. Look out for missing identifiers or incorrectly formatted contents.

  3. Expand coverage once signals are stable.

Rollout best practices

Keep implementation centralized

  • Use 1 shared include in the header or component across pages.

  • Avoid duplicate script loading.

  • Make it easy to update once and deploy everywhere by modularizing tags, definitions, and includes.

Add a server-side kill switch

Implement a server-side flag that can disable all tags quickly. Use this if:

  • A script introduces performance issues.

  • Inconsistent data is being sent from one or more tags.

  • There is a security or incident response need.

  • Tag costs spike unexpectedly.

The intent for the server-side kill switch isn't daily control but operational safety.

Version control for the script

Store the script version in a server-side variable so you can:

  • Upgrade deliberately when new capabilities are needed.

  • Roll back if issues arise after release.

  • Keep test and production aligned.

Verify the setup works

After completing your rollout:

  1. Confirm that production data appears in the platform.

    • If you get test data in production, the environment isn't correctly set. Verify the setEnvironment call.

  2. Check that test data remains separate from production.

  3. Validate that audiences and journeys using new events behave as expected.

    • If events are missing from some pages, check the page coverage to see if your rollout is incomplete.

  4. Monitor page load performance for any regressions.

    • If your page performance has issues, you may have too many tags loading. To fix this, review the tag loading rules.

    • If the tags are behaving unexpectedly, the properties may be stale. Check that you have set up a reset between views in single-page applications.

More resources