Skip to content

Marketing skills for Claude Code and AI agents. CRO, copywriting, SEO, analytics, and growth engineering.

fix(analytics): read canonical prices without display parsing

Rudy Celeklie26b55182fa4
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index ea384a9..a6f60db 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -6,7 +6,7 @@
},
"metadata": {
"description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, and growth",
- "version": "2.11.17",
+ "version": "2.11.18",
"repository": "https://github.com/coreyhaines31/marketingskills"
},
"plugins": [
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index 83527da..d155ceb 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "marketing-skills",
"description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth",
- "version": "2.11.17",
+ "version": "2.11.18",
"author": {
"name": "Corey Haines"
},
diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index 7f59e6e..5884655 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "marketing-skills",
"description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth",
- "version": "2.11.17",
+ "version": "2.11.18",
"author": {
"name": "Corey Haines"
},
diff --git a/VERSIONS.md b/VERSIONS.md
index 404f2de..40f7ae0 100644
--- a/VERSIONS.md
+++ b/VERSIONS.md
@@ -7,7 +7,7 @@ Current versions of all skills. Agents can compare against local versions to che
| ab-testing | 2.0.0 | 2026-05-05 |
| ad-creative | 2.9.3 | 2026-10-02 |
| ai-seo | 2.7.2 | 2026-10-02 |
-| analytics | 2.0.2 | 2026-10-02 |
+| analytics | 2.0.3 | 2026-10-02 |
| aso | 2.0.1 | 2026-08-19 |
| attribution | 1.1.2 | 2026-10-02 |
| churn-prevention | 2.0.1 | 2026-10-02 |
@@ -57,6 +57,10 @@ Current versions of all skills. Agents can compare against local versions to che
## Recent Changes
+### 2.11.18
+
+- Fix analytics price extraction: use canonical machine-readable amounts, preserve free items, and keep missing/invalid prices out of monetary events.
+
### 2.11.17 (2026-10-02)
- **video** (2.2.0 → 2.2.1) and the **Hyperframes integration guide** (reported in #600 by @pjthegiant): the old example called a `render({ frames })` API that the `hyperframes` package doesn't export. Both now lead with the CLI (`npx hyperframes init`, `preview`, `render -o output.mp4`) and explain the composition format: a root with `data-composition-id`, `class="clip"` elements with timing attributes, and a paused GSAP timeline. Rendering from code goes through `@hyperframes/producer` (`createRenderJob` + `executeRenderJob`). Checked against v0.8.114.
diff --git a/skills/analytics/SKILL.md b/skills/analytics/SKILL.md
index e849eca..28b49fc 100644
--- a/skills/analytics/SKILL.md
+++ b/skills/analytics/SKILL.md
@@ -2,7 +2,7 @@
name: analytics
description: When the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics," "conversion tracking," "event tracking," "UTM parameters," "tag manager," "GTM," "analytics implementation," "tracking plan," "how do I measure this," "track conversions," "Mixpanel," "Segment," "are my events firing," or "analytics isn't working." Use this whenever someone asks how to know if something is working or wants to measure marketing results. For choosing attribution models, comparing multi-touch/MMM/incrementality, or reconciling conflicting numbers across tools, see attribution. For A/B test measurement, see ab-testing.
metadata:
- version: 2.0.2
+ version: 2.0.3
---
# Analytics Tracking
diff --git a/skills/analytics/evals/evals.json b/skills/analytics/evals/evals.json
index fd3df6a..387a673 100644
--- a/skills/analytics/evals/evals.json
+++ b/skills/analytics/evals/evals.json
@@ -85,6 +85,19 @@
"Does not attempt to design the full experiment"
],
"files": []
+ },
+ {
+ "id": 7,
+ "prompt": "Our GTM Custom JavaScript price variable parses .product-price text. USD $1,234.56 is tracked as 1, a European 1.234,56 display as 1.234, and missing prices become zero. How should we fix this without changing real free items?",
+ "expected_output": "Use the application numeric amount and explicit currency or a machine-readable unformatted decimal data-price attribute. Do not strip symbols or guess locale separators. Return null for missing/malformed/nonfinite values and skip or diagnose the monetary event; preserve canonical zero for free items. Test grouped US and localized European display strings, ordinary decimals and missing/invalid values.",
+ "assertions": [
+ "Uses numeric application data or canonical machine-readable decimal",
+ "Does not parse localized display strings or guess currency",
+ "Preserves explicit zero for free items",
+ "Missing or invalid amount is not converted to zero",
+ "Tests grouped and localized display controls"
+ ],
+ "files": []
}
]
}
diff --git a/skills/analytics/references/gtm-implementation.md b/skills/analytics/references/gtm-implementation.md
index 956e638..6012d1c 100644
--- a/skills/analytics/references/gtm-implementation.md
+++ b/skills/analytics/references/gtm-implementation.md
@@ -382,9 +382,15 @@ function() {
return match ? match[2] : null;
}
-// Get data from page
+// Read a machine-readable amount, not the localized display text.
+// Example: <span class="product-price" data-price="1234.56">$1,234.56</span>
function() {
var el = document.querySelector('.product-price');
- return el ? parseFloat(el.textContent.replace('$', '')) : 0;
+ var raw = el ? el.getAttribute('data-price') : null;
+ if (raw === null || !/^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/.test(raw)) return null;
+ var amount = Number(raw);
+ return isFinite(amount) ? amount : null;
}
```
+
+For monetary tracking, prefer the numeric amount and currency from the application data layer. If a DOM variable is needed, have the application render `data-price` as an unformatted, non-negative decimal in major currency units; pass its currency separately. Do not infer the amount or currency from presentation text: `parseFloat` turns `$1,234.56` into `1` after removing `$`, and localized separators have different meanings. A missing or invalid amount returns `null`, so skip that monetary event or diagnose it before sending; reserve `0` for an explicitly free item.