# Analytics Event Release QA (`afkdigital/newapi92-analytics-event-release-qa`) Actor

Offline release QA for analytics test recordings: missing observations, duplicate rules, parameter drift and optional event sequence contracts.

- **URL**: https://apify.com/afkdigital/newapi92-analytics-event-release-qa.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 test session pair compareds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Analytics Event Release QA

Compare recorded baseline and candidate analytics test sessions before a release. Detect events not observed in recordings, duplicate triggers under explicit customer rules, missing required parameters, schema/type drift and optional sequence deviations. No browser, analytics account, advertising account, proxy or third-party API key is required.

### Quick start

Run the default input: five paired scenarios cover missing purchase, double trigger, lost product ID, value type change and legitimate repeating heartbeats. Expected runtime is under five minutes. Download findings as JSON or CSV from the default Dataset; read OUTPUT in the key-value store for completion status. A clean pair produces no finding row but still counts as one compared pair.

### Recording format

Each record requires string scenario_id, session_id, event_name and an optional parameters object. JSON is an array of records. CSV requires headers scenario_id,session_id,event_name,parameters; the parameters cell is a JSON object, with normal CSV quote escaping. CSV values inside the JSON object retain JSON types; flat CSV parameter inference is deliberately unsupported.

baselineEventsFile and candidateEventsFile accept inline JSON rows. To import JSON/CSV files, set the corresponding EventsFile to \[] and pass the file contents through baselineRecording or candidateRecording: {"content":"CSV or JSON text"}. Local paths, URLs and external key-value-store references are unsupported. No extra account permission is needed. Customer API clients can read a local file and serialize its text into this content field.

### Explicit pairing and expectations

scenarioMapping is an array of objects: scenario_id, baseline_session_id, candidate_session_id, expectedEvents, ordered. Each recording session may occur in only one pair. Random session IDs across releases require explicit pairs. With an empty mapping, only identical scenario/session keys are paired; unmatched recordings generate unpaired_recording, remain uncharged and mark the report partial. With explicit mappings, only listed pairs are processed; other recordings are outside scope. Output scenario IDs are hashed, output session IDs are pair ordinals. Source row numbers allow local reconciliation without publishing raw session IDs.

expectedEvents is a list (including repeats) that establishes minimum event counts for both recordings. When omitted, the baseline event list establishes minimum counts. Sequence checking is off by default; ordered:true requires the filtered event-name sequence to exactly equal expectedEvents (extra events count as deviations). Type comparisons match same-name event occurrences by ordinal after explicit retry filtering. This is not semantic matching of individual transactions.

eventSchema maps event names to parameter paths and JSON types: string, number, boolean, array, object, null. A schema type alone does not make a field required. requiredParameters maps event names to required parameter path arrays. Paths are relative to parameters unless prefixed with parameters. Use numeric path components for schema checks inside arrays. Differential type checking treats arrays as array types, not individual item contracts.

### Ignored fields and repeat rules

ignoredFields accepts dotted paths, parent paths and shell-style wildcards, such as timestamp, session_id, parameters.request_id and parameters.device.\*. Ignored parameters do not participate in type, required-field or duplicate key checks. Field values are never emitted even when not ignored.

dedupRules is keyed by event name. Example:
{"purchase":{"keyFields":\["parameters.transaction_id"],"maxOccurrences":1,"retryField":"parameters.retry","retryValue":true},"heartbeat":{"allowRepeat":true}}

Duplicate detection is opt-in. keyFields define equality within each recording session. More than maxOccurrences (default 1) is a duplicate_trigger. Missing/unspecified duplicate keys produce an informational dedup_rule_incomplete finding, not a duplicate accusation. allowRepeat:true permits repeats. retryField and retryValue explicitly exclude matching retry records before all contract and sequence checks; use these only when excluding retries is appropriate. No implicit time window or heuristic retry inference is used. Distinct transactions need distinct supplied key values. Unconfigured repeats may generate count-change findings but are never labeled duplicate triggers.

### Outputs and privacy

Dataset fields: scenario_id, session_id, event_name, finding_type, parameter_path, expected_value, actual_value, severity, evidence_rows; recording_side adds baseline/candidate context. Values contain types, counts, schema presence and event-name sequences, never raw parameter payloads. Evidence contains source side and 1-based data record row numbers (CSV header excluded). Do not put personal information in event names, parameter keys or scenario labels. Uploaded input remains in your Apify run/storage according to your own retention settings.

High severity means a contract, sequence or rule violation; warning means a recording count changed; info means insufficient evidence or an incomplete comparison. Baseline violations are reported as well as candidate violations.

### Limits and partial results

Hard caps: 5 MiB per recording, 20000 events per recording side, 1000 events per session, 100 completed pairs/run, 10000 findings/pair, 8 MiB aggregate completed-pair findings, 180 seconds comparison time and 300 seconds Actor timeout. Lower limits may be configured. Malformed or oversized input files fail validation before comparison. A session over its event cap is skipped intact and uncharged. A pair reaching time/finding/report-size limits discards its unfinished findings, emits pair_incomplete and is uncharged. Completed earlier pairs are retained. OUTPUT.partial always needs checking; deliveryComplete must be true to treat the final summary as delivered. Infrastructure hard termination can leave an incomplete report: consult run status.

### Pricing

Pay-per-event charge: USD 0.10 per completed test session pair (USD 100 per 1000 pairs). One pair means one baseline and one candidate recording for a scenario, with up to 1000 events on each side. Findings are not separately charged; clean pairs count. Unpaired, skipped and unfinished pairs are not charged. The implementation checks the remaining event budget and uses one idempotent session-pair-compared event per completed pair. There is no start or Dataset-item fee. Platform usage is included in this event price.

### Interpretation

An event absent from a recording does not prove the application never generated it: recorder coverage, filtering, consent and export gaps can all matter. This tool validates supplied test evidence. It does not guarantee live analytics accuracy, dashboard totals, advertising conversion attribution, delivery to vendors or legal compliance.

### Development

Version 1.0.0. Run python3 -m unittest discover -s tests -v, then docker build -t newapi92:1.0.0 . . Demo input: examples/demo.json. AFK Digital.

# Actor input Schema

## `baselineEventsFile` (type: `array`):

Inline event rows. Alternatively leave empty and supply the corresponding Recording object with CSV/JSON content or an Apify key-value record reference.

## `baselineRecording` (type: `object`):

Optional {content: CSV or JSON text}. Pass file contents directly. Paths, URLs and external stores are unsupported.

## `candidateEventsFile` (type: `array`):

Inline event rows. Alternatively leave empty and supply the corresponding Recording object with CSV/JSON content or an Apify key-value record reference.

## `candidateRecording` (type: `object`):

Optional {content: CSV or JSON text}. Pass file contents directly. Paths, URLs and external stores are unsupported.

## `eventSchema` (type: `object`):

Event name -> parameter path -> string, number, boolean, array, object or null.

## `requiredParameters` (type: `object`):

Event name -> required parameter paths.

## `dedupRules` (type: `object`):

Event name -> keyFields, maxOccurrences, allowRepeat, retryField and retryValue. No inferred duplicate claims.

## `scenarioMapping` (type: `array`):

Each row: scenario_id, baseline_session_id, candidate_session_id, expectedEvents array and ordered boolean. Empty matches identical keys only.

## `ignoredFields` (type: `array`):

Dotted paths or shell-style wildcards. An ignored parent excludes children.

## `maxSessions` (type: `integer`):

Hard upper bound; incomplete pairs are not charged.

## `maxEventsPerSession` (type: `integer`):

Hard upper bound; incomplete pairs are not charged.

## `timeLimitSeconds` (type: `integer`):

Hard upper bound; incomplete pairs are not charged.

## Actor input object example

```json
{
  "baselineEventsFile": [
    {
      "scenario_id": "missing-purchase",
      "session_id": "before-missing-purchase",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "missing-purchase",
      "session_id": "before-missing-purchase",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "double-trigger",
      "session_id": "before-double-trigger",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "double-trigger",
      "session_id": "before-double-trigger",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "lost-product",
      "session_id": "before-lost-product",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "lost-product",
      "session_id": "before-lost-product",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "type-change",
      "session_id": "before-type-change",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "type-change",
      "session_id": "before-type-change",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "before-legitimate-repeat",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "before-legitimate-repeat",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "before-legitimate-repeat",
      "event_name": "heartbeat",
      "parameters": {
        "sequence": 0
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "before-legitimate-repeat",
      "event_name": "heartbeat",
      "parameters": {
        "sequence": 1
      }
    }
  ],
  "baselineRecording": {},
  "candidateEventsFile": [
    {
      "scenario_id": "missing-purchase",
      "session_id": "after-missing-purchase",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "double-trigger",
      "session_id": "after-double-trigger",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "double-trigger",
      "session_id": "after-double-trigger",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "double-trigger",
      "session_id": "after-double-trigger",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "lost-product",
      "session_id": "after-lost-product",
      "event_name": "view",
      "parameters": {}
    },
    {
      "scenario_id": "lost-product",
      "session_id": "after-lost-product",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "type-change",
      "session_id": "after-type-change",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "type-change",
      "session_id": "after-type-change",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": "10"
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "after-legitimate-repeat",
      "event_name": "view",
      "parameters": {
        "product_id": "P1"
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "after-legitimate-repeat",
      "event_name": "purchase",
      "parameters": {
        "transaction_id": "T1",
        "value": 10
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "after-legitimate-repeat",
      "event_name": "heartbeat",
      "parameters": {
        "sequence": 0
      }
    },
    {
      "scenario_id": "legitimate-repeat",
      "session_id": "after-legitimate-repeat",
      "event_name": "heartbeat",
      "parameters": {
        "sequence": 1
      }
    }
  ],
  "candidateRecording": {},
  "eventSchema": {
    "view": {
      "product_id": "string"
    },
    "purchase": {
      "value": "number",
      "transaction_id": "string"
    }
  },
  "requiredParameters": {
    "view": [
      "product_id"
    ],
    "purchase": [
      "transaction_id",
      "value"
    ]
  },
  "dedupRules": {
    "purchase": {
      "keyFields": [
        "parameters.transaction_id"
      ],
      "maxOccurrences": 1
    },
    "heartbeat": {
      "allowRepeat": true
    }
  },
  "scenarioMapping": [
    {
      "scenario_id": "missing-purchase",
      "baseline_session_id": "before-missing-purchase",
      "candidate_session_id": "after-missing-purchase",
      "expectedEvents": [
        "view",
        "purchase"
      ],
      "ordered": false
    },
    {
      "scenario_id": "double-trigger",
      "baseline_session_id": "before-double-trigger",
      "candidate_session_id": "after-double-trigger",
      "expectedEvents": [
        "view",
        "purchase"
      ],
      "ordered": false
    },
    {
      "scenario_id": "lost-product",
      "baseline_session_id": "before-lost-product",
      "candidate_session_id": "after-lost-product",
      "expectedEvents": [
        "view",
        "purchase"
      ],
      "ordered": false
    },
    {
      "scenario_id": "type-change",
      "baseline_session_id": "before-type-change",
      "candidate_session_id": "after-type-change",
      "expectedEvents": [
        "view",
        "purchase"
      ],
      "ordered": false
    },
    {
      "scenario_id": "legitimate-repeat",
      "baseline_session_id": "before-legitimate-repeat",
      "candidate_session_id": "after-legitimate-repeat",
      "expectedEvents": [
        "view",
        "purchase",
        "heartbeat",
        "heartbeat"
      ],
      "ordered": false
    }
  ],
  "ignoredFields": [
    "timestamp",
    "session_id"
  ],
  "maxSessions": 100,
  "maxEventsPerSession": 1000,
  "timeLimitSeconds": 180
}
```

# Actor output Schema

## `findings` (type: `string`):

No description

## `csv` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/newapi92-analytics-event-release-qa").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/newapi92-analytics-event-release-qa").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call afkdigital/newapi92-analytics-event-release-qa --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/newapi92-analytics-event-release-qa"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/taOVCsS8rugH57Bq9/builds/GgGzuB55JzNlthkGU/openapi.json
