{
  "version": 1,
  "name": "Variafy attribution test lab",
  "data": "All ad IDs, payment references and lead references are fictional.",
  "scenarios": [
    {
      "id": "exact-ids",
      "title": "Exact 18-digit ad IDs",
      "issue": "Three payment rows carry IDs that appear in the ad export.",
      "fix": "Use this pair as the baseline before testing a changed export.",
      "tip": "",
      "adsFile": "exact-ids-ads.csv",
      "paymentsFile": "exact-ids-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 3,
        "missing": 0,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "missing-ad-ids",
      "title": "The ad ID is missing from the payment",
      "issue": "Two payment rows have an empty ID field. Their references keep the rows visible.",
      "fix": "Follow a test lead from the landing page or form to the CRM and then to the payment export.",
      "tip": "",
      "adsFile": "missing-ad-ids-ads.csv",
      "paymentsFile": "missing-ad-ids-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 1,
        "missing": 2,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "outside-export",
      "title": "The ad ID is outside this export",
      "issue": "Two numeric IDs are present on payments but absent from the selected ad export.",
      "fix": "Check the ad account and export dates. Include the ads that could have generated the original leads.",
      "tip": "A missing match alone cannot tell you whether the account, date range or stored ID is wrong.",
      "adsFile": "outside-export-ads.csv",
      "paymentsFile": "outside-export-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 1,
        "missing": 0,
        "unmatched": 2,
        "invalid": 0
      }
    },
    {
      "id": "scientific-notation",
      "title": "An ID became scientific notation",
      "issue": "One payment ID is written as an exponent instead of the original digits.",
      "fix": "Export the original ID again as text. Expanding a rounded exponent cannot recover the missing digits.",
      "tip": "",
      "adsFile": "scientific-notation-ads.csv",
      "paymentsFile": "scientific-notation-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 1,
        "missing": 0,
        "unmatched": 1,
        "invalid": 1
      }
    },
    {
      "id": "rounded-id",
      "title": "An ID was rounded but still looks numeric",
      "issue": "One payment contains a different 18-digit value after a simulated spreadsheet conversion.",
      "fix": "Compare the exact digits with the original export. Import ID columns as text before editing.",
      "tip": "The checker can flag nonnumeric IDs. A rounded all-digit ID looks valid and appears as no matching ad.",
      "adsFile": "rounded-id-ads.csv",
      "paymentsFile": "rounded-id-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 1,
        "missing": 0,
        "unmatched": 1,
        "invalid": 0
      }
    },
    {
      "id": "unexpanded-parameter",
      "title": "A tracking parameter was never expanded",
      "issue": "One payment stores the literal tag {{ad.id}}.",
      "fix": "Check the live ad link and the field passed into your CRM. Save the resolved numeric ID.",
      "tip": "",
      "adsFile": "unexpanded-parameter-ads.csv",
      "paymentsFile": "unexpanded-parameter-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 1,
        "missing": 0,
        "unmatched": 1,
        "invalid": 1
      }
    },
    {
      "id": "installments",
      "title": "One lead makes three payments",
      "issue": "Three fictional installments carry the same ad ID.",
      "fix": "Keep one row per payment when checking payment coverage. Use a separate customer identifier to count customers.",
      "tip": "The result is three matched payment rows. It does not establish three customers or calculate revenue.",
      "adsFile": "installments-ads.csv",
      "paymentsFile": "installments-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 3,
        "missing": 0,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "duplicate-ads",
      "title": "The ad export contains duplicate rows",
      "issue": "The same ad appears twice in the ad export. Each payment still counts once.",
      "fix": "Remove duplicated export rows when building a spend report. ID matching alone does not reconcile duplicated spend.",
      "tip": "",
      "adsFile": "duplicate-ads-ads.csv",
      "paymentsFile": "duplicate-ads-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 2,
        "missing": 0,
        "unmatched": 1,
        "invalid": 0
      }
    },
    {
      "id": "semicolon-export",
      "title": "The CSV uses semicolons",
      "issue": "Both files use a semicolon separator, and an ad name contains a comma.",
      "fix": "Keep the separator and quoting produced by the CSV exporter. Commas in a name do not identify the separator.",
      "tip": "",
      "adsFile": "semicolon-export-ads.csv",
      "paymentsFile": "semicolon-export-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 2,
        "missing": 1,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "utf8-bom-and-quotes",
      "title": "The export contains UTF-8, tabs and quoted text",
      "issue": "The files have a UTF-8 byte order mark, tab separators and quoted text with a line break.",
      "fix": "Export as UTF-8 and keep quoted cells intact. A line break inside a quoted cell stays in one record.",
      "tip": "",
      "adsFile": "utf8-bom-and-quotes-ads.csv",
      "paymentsFile": "utf8-bom-and-quotes-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 2,
        "missing": 1,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "choose-id-column",
      "title": "Two columns look like ad IDs",
      "issue": "The payment export contains both Meta Ad ID and utm_content. This fixture stores the original ID in utm_content.",
      "fix": "Confirm which field contains the original ad ID. For this test choose Column 2 in the payments file.",
      "tip": "The lab selects the documented column. Choosing Column 1 would instead produce two unmatched rows.",
      "adsFile": "choose-id-column-ads.csv",
      "paymentsFile": "choose-id-column-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 2,
        "missing": 0,
        "unmatched": 0,
        "invalid": 0
      }
    },
    {
      "id": "invalid-meta-export",
      "title": "The ad export itself contains an invalid ID",
      "issue": "The Meta Ads ID column contains scientific notation. A reliable comparison cannot start.",
      "fix": "Export the ad IDs again as text. Then load the corrected file and run the check.",
      "tip": "",
      "adsFile": "invalid-meta-export-ads.csv",
      "paymentsFile": "invalid-meta-export-payments.csv",
      "adsColumn": 0,
      "paymentsColumn": 1,
      "expected": {
        "matched": 0,
        "missing": 0,
        "unmatched": 0,
        "invalid": 0,
        "error": "The selected Meta Ads column contains a blank or invalid ID. Choose the Ad ID column or export it as plain text."
      }
    }
  ]
}
