Skip to content
Skills Library
Data & analytics · Building & coding

conversion-event-tracking

/conversion-event-tracking

Send commerce analytics events with stable names, item ids, and a purchase event that fires once from a confirmed order. Use when adding or changing view_item, add_to_cart, begin_checkout, purchase, or refund tracking.

Licence
MIT
Last repository change
04.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/check-event.mjs

What it does and when to use it

Send commerce analytics events with stable names, item ids, and a purchase event that fires once from a confirmed order. Use when adding or changing view_item, add_to_cart, begin_checkout, purchase, or refund tracking.

Original author description

Send commerce analytics events with stable names, item ids, and a purchase event that fires once from a confirmed order. Use when adding or changing view_item, add_to_cart, begin_checkout, purchase, or refund tracking.

How it works

  1. Procedure
  2. Purchase
  3. Items
  4. Consent and duplicates
  5. Gotchas
  6. Verification
  7. Evaluation
Original SKILL.md headings · 56 lines, 549 words
SKILL.md preview
---
name: conversion-event-tracking
description: "Send commerce analytics events with stable names, item ids, and a purchase event that fires once from a confirmed order. Use when adding or changing view_item, add_to_cart, begin_checkout, purchase, or refund tracking."
license: MIT
compatibility: "The event checker requires Node.js 20 or newer. No network access."
metadata:
  author: Naser Sadrmanesh
  version: "0.3.3"
---

# Conversion event tracking

Use this skill for measurement events. Checkout behavior is the checkout skill. Firing `purchase` before the payment skill confirms the order will count money you did not take.

Event names and parameter rules below follow Google's GA4 recommended ecommerce events. Other analytics tools should use the same payload shape in this project so there is one server-side record. Re-check GA4's event reference if a report disagrees with a parameter.

## Procedure

1. Use the recommended names: `view_item`, `add_to_cart`, `begin_checkout`, `add_shipping_info`, `add_payment_info`, `purchase`, and `refund`.
2. Send `items` with `item_id` (the SKU or stable unit id) and `item_name`. Include `price` and `quantity` when you send `value`.
3. Set `value` to the sum of `price * quantity`. Do not include shipping or tax in `value`. Send those as `shipping` and `tax` on `purchase`.
4. If `value` is set, set `currency` to the order's ISO 4217 code.
5. Fire `purchase` once, from the server-confirmed payment, with a non-empty `transaction_id` equal to the order number.
6. Respect the shop's consent settings before loading advertising tags. Do not describe that as a universal legal rule. The shop's policy decides where consent is required.

Parameter checks are in [the event notes](references/events.md). Run `node scripts/check-event.mjs --file event.json`. Worked examples and checks are in [evals/tasks.json](evals/tasks.json).

## Purchase

`transaction_id` is required for `purchase`. GA4 deduplicates purchases that share a transaction id on web streams. An empty string is a bad id: Google documents that purchases with `transaction_id=""` are deduplicated together. Never send an empty id.

The thank-you page may render the event only if a reload will send the same `transaction_id`. Prefer sending `purchase` from the server when payment is confirmed, and treat the browser event as a duplicate of that id rather than a second order.

`value` excludes tax and shipping. A 10.00 item, 1.00 tax, and 2.00 shipping is `value: 10`, `tax: 1`, `shipping: 2`, not `value: 13`.

## Items

- `item_id` is the purchasable unit, not only the parent, when variants have different prices.
- `quantity` is an integer greater than zero for a purchase line.
- Do not put the customer's name, email, or phone on the item or the event.

## Consent and duplicates

- If the shop requires consent for advertising measurement, do not load those tags before the choice is stored.
- Order-state analytics the merchant runs on their own server can still record the paid order. Keep that separate from a browser advertising tag.
- `refund` uses the same `transaction_id` as the purchase and the refunded `items` or value. Do not reuse a purchase event to mean a refund.

## Gotchas

- Firing `purchase` on button click counts failed payments.
- A new transaction id on every page load defeats deduplication and over-counts.
- Summing tax into `value` overstates item revenue in GA4's definition.
- Debug views that use a constant transaction id will collapse real orders together if that code ships.

## Verification

- The checker accepts a purchase whose `value` equals the item sum and rejects a purchase with an empty `transaction_id`.
- A declined payment does not emit `purchase`.
- Reloading the confirmation page does not create a second transaction id.
- Item ids on variant products are variant SKUs.

## Evaluation

Worked examples and the checks they must satisfy are in [evals/tasks.json](evals/tasks.json).
Files in this package (6)
  • SKILL.md 4 KB
  • evals/tasks.json 1 KB
  • evals/examples/purchase-once.md 1 KB
  • evals/examples/variant-item-id.md 1 KB
  • references/events.md 1 KB
  • scripts/check-event.mjs 3 KB

Versions

The database has no other skills named conversion-event-tracking.

Database snapshot: 13.11.2026 · package version 8ca26b6bcf87 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100analytics-tracking
    Writes and audits analytics tracking plans: event names and properties, naming conventions, UTM parameters, conversion and funnel events, and GA4, GTM, Mixpanel, Amplitude, PostHog or Segment setup. Use when the user asks for a tracking plan, event tracking for a launch,…
  • 95analytics-tracking
    Set up, audit, and debug analytics tracking implementation — GA4, Google Tag Manager, event taxonomy, conversion tracking, and data quality. Use when building a tracking plan from scratch, auditing existing analytics for gaps or errors, debugging missing events, or setting up…
  • 95analytics-tracking
    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," or…
  • 100tracking-spec
    Define an event or audit implemented events against the ontology and list gaps. Use when "define the event for X", "is tracking right", "GA4 audit".
  • 100conversion-value-mismatch-leak
    Compares the value per purchase that Meta and Google report with the real average order value of the orders Shopify attributes to them, to catch purchase events that send tax, shipping, the wrong currency or a fixed value - which makes ROAS wrong even when the purchase count is…
  • 100analytics
    Instrument and discover analytics events in Sentry's frontend UI. Use when adding tracking to buttons, pages, modals, or custom interactions, when defining new analytics events, when searching for existing events, when auditing analytics coverage for a feature, or when answering…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.