Skip to main content
All CollectionsFor WebQA & Debugging
How to QA metric capture
How to QA metric capture
Updated over 11 months ago

You can QA metric capture both from the side of firing the metric and then from seeing the metric in the Reporting Interface.

This document describes the most thorough way in which you can test metric capture - most often it's sufficient to just check the output with metrics rolling up into the UI.

QAing the metric firing

Step 1: Make sure the event hook fires

The first thing to check is always if your event hook is firing, especially when it's an event-based metric e.g. click, scroll, etc.

The recommended approach is to fire a console log before sending the metric.

document.addEventListener("click", e => {
if(!e.target.closest('.mybutton')) return;

console.log("CLICK - MyButton"); // <------ ADD THIS
WT.click({
testAlias: "ta_123",
conversionPoint: "Click MyButton"
});
});
  • If the console log fires, you know the event should be sent to WTO.

  • If the console log doesn't fire, you know the event won't be sent to WTO, and you have work to do on your event hooking.

The Optimize Build Framework does this automatically when using Test.conversion. In that case, all you need is the Debug Mode to be active, and you'll see the appropriate logs in the console.

Step 2: Check the network request

You'll be able to see network requests going out to ots.webtrends-optimize.com.

If this doesn't happen when you expect it to, you know the metric isn't being sent out. The best settings for testing this are:

  1. Clear the network tab just before sending the metric

  2. Enable "Preserve log" to make sure it doesn't disappear even if the page redirects away.

Note that many requests are encrypted, so the details of the metric may not be easily readable.

Step 3: Checking the tag debugger

That tag debugger will show both the metric being sent out, and a response. Most importantly, it will flag issues tracking the metric if found.

Full details for this are available to read at Debug Mode > Conversion tracking.

QAing the data rollup

Step 4: Checking data rollup

Finally, you can check data rolling up into the Reporting Interface.

Data typically rolls up in between 5-30 minutes depending on how much data we're being sent in the moment (a time we're looking to improve on).

To validate rollup, simply go into the Report screen for that test, and you'll see the metrics laid out for you.

Step 5: Custom Data

If you're sending Custom Data into Optimize, there's one additional step which is to make sure that data is in the format needed.

The above helps you validate the events that are being sent to us - for Custom Data you need to look at Data Extracts.

The minimum recommended fields to validate your capture are:

  • Date

  • Time

  • Experiment

  • Event

  • Data

"Data" will expand into a series of columns, one per field. This will be available as a zipped CSV, which you can view and make sense of in a viewer like Excel.

Did this answer your question?