Skip to content

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

Replace the Wix Bookings listener with the live-checked one

Aaron Beashelad6903e9b89c
diff --git a/VERSIONS.md b/VERSIONS.md
index 4e2d4e7..12125f4 100644
--- a/VERSIONS.md
+++ b/VERSIONS.md
@@ -63,7 +63,7 @@ Current versions of all skills. Agents can compare against local versions to che
- Added the **`conversion-tracking`** skill (1.0.0). Setting up, auditing, verifying and fixing the path from a conversion on a website to Google Ads, Meta, GA4, LinkedIn, TikTok and Microsoft Ads, for lead generation and ecommerce. Gives an orphaned job a home. Analytics listed conversion tracking as a trigger without covering it, attribution routed pixels and CAPI to ads, and ads held one reference file. Built on one distinction, that lead gen has to infer success from a browser signal while ecommerce reads it from an order record. Nine references (how each form, booking and chat tool signals success, the complete browser-side path, the server-side options with prices, ecommerce platforms including Shopify's 26 Aug 2026 Additional Scripts removal, Google Ads, Meta, other platforms, the audit playbook, and why the numbers never match), 22 detection snippets, importable GTM recipes merged by `scripts/build_recipe.py`, and 16 evals. Audit scoring follows the ads skill's audit guardrails, summarised inline. New skill = repo y release; total skills: 51. Contributed by Aaron Beashel (Converly ◆, a Verified Partner) and reviewed against the repo's partner-integrity bar before merge:
- **Neutrality:** free and native paths first (browser Enhanced Conversions, Meta advanced matching, Google tag gateway, Meta CAPI Gateway, tool webhooks); a "when server-side matters less" section; the partner row matches the others in length and lists its tradeoffs; a free-tier row in the side-by-side; paid options surface at the delivery decision, not in every answer; the contributor's other tool (Attributer) is disclosed with alternatives; five neutrality evals (ids 17–21) and one delivery-decision eval (id 22).
- **Facts:** browser tags can send hashed email and phone; Meta dropped the AEM 8-event cap in May 2023; Microsoft has a Conversions API (self-serve token, still rolling out); LinkedIn dedup needs a shared `eventId`; Meta CAPI for CRM gates; Google tROAS vs tCPA minimums; conversion-adjustment windows; Shopify's 1 Oct 2026 script-tag change; the undercount stated as a 10–30% range rather than a universal 30%.
- - **Assets:** 17 detection snippets replaced with listeners that passed live checks on real forms, Jotform's now firing on the completion message its iframe and script embeds send, and Framer's confirming through Framer's own form request; every GTM recipe uses Tag Manager's import format, so Import Container accepts it; 10 drifted GTM recipes regenerated from their snippets, with `scripts/check_recipes.py` to keep them in sync; `build_recipe.py` validates every ID and substitutes safely (no JSON or JS injection) on Python 3.8+; every send tag requires consent (the Google Ads conversion tag `ad_storage` only); snippet success-signal types documented.
+ - **Assets:** 18 detection snippets replaced with listeners that passed live checks on real forms, Jotform's now firing on the completion message its iframe and script embeds send, and Framer's confirming through Framer's own form request; every GTM recipe uses Tag Manager's import format, so Import Container accepts it; 10 drifted GTM recipes regenerated from their snippets, with `scripts/check_recipes.py` to keep them in sync; `build_recipe.py` validates every ID and substitutes safely (no JSON or JS injection) on Python 3.8+; every send tag requires consent (the Google Ads conversion tag `ad_storage` only); snippet success-signal types documented.
- **Repo fit:** operative rules in the description, a revops boundary, no cross-skill relative links, two audit checks restored from the retired ads reference.
- **Converly integration guide** filled in (capabilities, setup, operations); platform lift stats carry a holdout caveat.
- **analytics** (2.0.1 → 2.0.2): description drops the "conversion tracking" and "track conversions" triggers and hands getting conversions into ad platforms to conversion-tracking.
diff --git a/skills/conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json b/skills/conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json
index 1c06a31..18bbfbb 100644
--- a/skills/conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json
+++ b/skills/conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json
@@ -29,7 +29,7 @@
{
"type": "TEMPLATE",
"key": "html",
- "value": "<script>\n(function () {\n if (window.__ctDetectWixScheduling) return;\n window.__ctDetectWixScheduling = true;\n window.dataLayer = window.dataLayer || [];\n\n // The booking CTA's Wix-controlled data-hook (app-level, theme-stable).\n var BOOK_NOW_HOOK = 'booking-details-book-now-cta';\n // The order-confirmation page's Wix-controlled marker (slug-independent).\n var THANKYOU_HOOK = 'ThankYouPageAppDataHook.root';\n\n // localStorage key for the cross-page marker. Deliberately distinct from\n // the production loader's key so this recipe never collides with it.\n var STASH_KEY = '__cvlyRecipeWixSchedStash';\n // How long a click-marker stays valid. The form\u2192confirmation navigation\n // is immediate for free services; generous to absorb slow networks and\n // (best-effort) a paid service's checkout step.\n var STASH_TTL_MS = 10 * 60 * 1000; // 10 minutes\n // How long, on a given page load, we wait for the confirmation marker to\n // render (Wix boots its widgets asynchronously) before giving up.\n var THANKYOU_WAIT_MS = 12000;\n\n function now() {\n return Date.now();\n }\n\n function writeStash(obj) {\n try {\n window.localStorage.setItem(STASH_KEY, JSON.stringify(obj));\n } catch (e) {\n // Private mode / storage disabled \u2014 can't bridge the navigation, so\n // the booking simply won't be tracked. Fail quietly.\n }\n }\n\n function readStash() {\n try {\n var raw = window.localStorage.getItem(STASH_KEY);\n if (!raw) return null;\n var obj = JSON.parse(raw);\n return (obj && typeof obj === 'object') ? obj : null;\n } catch (e) {\n return null;\n }\n }\n\n function clearStash() {\n try { window.localStorage.removeItem(STASH_KEY); } catch (e) {}\n }\n\n function isFreshStash(stash) {\n return !!(stash && typeof stash.ts === 'number' && (now() - stash.ts) <= STASH_TTL_MS);\n }\n\n function fireConversion(bookingId, pageUrl) {\n var payload = {\n event: 'wix_appointment_scheduled',\n booking_page_url: pageUrl || ''\n };\n if (bookingId) payload.booking_id = bookingId;\n window.dataLayer.push(payload);\n }\n\n // ---- Booking form page: mark the Book Now click ----\n //\n // Simplification vs. the production module: because this recipe never\n // reads or reports form field values, it doesn't need to locate the\n // specific booking-form widget on the page (the source module climbs the\n // DOM to scope a field walk to the correct form) \u2014 matching on the\n // Wix-controlled CTA hook alone is enough to know a booking attempt was\n // made.\n function handleClick(event) {\n try {\n var target = event.target;\n if (!target || !target.closest) return;\n\n var btn = target.closest('[data-hook=\"' + BOOK_NOW_HOOK + '\"]');\n if (!btn) return;\n\n writeStash({\n // The page where the booking was submitted \u2014 the meaningful\n // pageUrl for the conversion (the confirmation page's URL carries\n // only a random booking UUID).\n pageUrl: window.location.pathname,\n ts: now()\n });\n } catch (e) {\n // Never throw back into Wix's own click handling.\n }\n }\n\n // ---- Confirmation page: fire on the success marker ----\n\n function isThankYouPage() {\n try {\n return !!document.querySelector('[data-hook=\"' + THANKYOU_HOOK + '\"]');\n } catch (e) {\n return false;\n }\n }\n\n function extractBookingId() {\n try {\n var m = window.location.pathname.match(\n /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i\n );\n return m ? m[0] : null;\n } catch (e) {\n return null;\n }\n }\n\n function fireFromThankYou() {\n // Consume-first idempotency: the stash is the single source of truth.\n // Clearing it before firing means a second call (observer + immediate\n // check racing) is a no-op.\n var stash = readStash();\n if (!stash) return;\n if (!isFreshStash(stash)) { clearStash(); return; }\n\n clearStash(); // consume before firing so re-entry can't double-fire\n\n fireConversion(extractBookingId(), stash.pageUrl);\n }\n\n // Runs at load on EVERY page. If a fresh booking marker exists and this\n // page is the confirmation page, fire. If the page hasn't rendered the\n // marker yet (Wix boots widgets async), watch for it within a bounded\n // window. On non-confirmation pages the watcher simply times out and\n // disconnects \u2014 harmless.\n function maybeFireOnThankYou() {\n var stash = readStash();\n if (!stash) return;\n if (!isFreshStash(stash)) { clearStash(); return; }\n\n if (isThankYouPage()) { fireFromThankYou(); return; }\n\n var done = false;\n var observer = null;\n var timer = null;\n\n function cleanup() {\n done = true;\n if (observer) { try { observer.disconnect(); } catch (e) {} observer = null; }\n if (timer) { clearTimeout(timer); timer = null; }\n }\n\n function check() {\n if (done) return;\n if (isThankYouPage()) {\n cleanup();\n fireFromThankYou();\n }\n }\n\n try {\n observer = new MutationObserver(check);\n observer.observe(document.documentElement || document.body, {\n childList: true,\n subtree: true\n });\n } catch (e) {\n // MutationObserver unavailable \u2014 the immediate check above already ran.\n }\n timer = setTimeout(cleanup, THANKYOU_WAIT_MS);\n }\n\n if (typeof document !== 'undefined' && document.addEventListener) {\n document.addEventListener('click', handleClick, true); // booking form\n maybeFireOnThankYou(); // confirmation page\n }\n})();\n</script>"
+ "value": "<script>\n(function () {\n if (window.__ctDetectWixScheduling) return;\n window.__ctDetectWixScheduling = true;\n window.dataLayer = window.dataLayer || [];\n\n // Wix Bookings checks out through Wix eCommerce. Once the order exists,\n // the shared Thank You page reports a Purchase through Wix's own site\n // analytics stream (window.wixDevelopersAnalytics). Its line items name\n // the Wix app that sold them, so a booking is an item from Wix Bookings\n // and a Wix Stores order is not. Only the event name, the line items'\n // app IDs and the order ID are read, never the buyer's details.\n var BOOKINGS_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';\n var LISTENER_ID = 'ctRecipeWixScheduling';\n var seen = {};\n var registered = false;\n\n function isBookingsItem(item) {\n try {\n return !!item && typeof item === 'object' && !!item.catalogReference &&\n item.catalogReference.appId === BOOKINGS_APP_ID;\n } catch (e) {\n return false;\n }\n }\n\n function orderIdOf(params) {\n var id = params.orderId;\n if (typeof id !== 'string' || !id) id = params.id;\n return typeof id === 'string' && /^[A-Za-z0-9-]{1,64}$/.test(id) ? id : '';\n }\n\n function onWixEvent(name, params) {\n try {\n if (name !== 'Purchase' || !params || typeof params !== 'object') return;\n var items = params.contents;\n if (!items || typeof items.length !== 'number') return;\n var booking = false;\n for (var i = 0; i < items.length; i++) {\n if (isBookingsItem(items[i])) { booking = true; break; }\n }\n if (!booking) return;\n var orderId = orderIdOf(params);\n if (!orderId || seen[orderId]) return;\n seen[orderId] = true;\n window.dataLayer.push({\n event: 'wix_appointment_scheduled',\n booking_id: orderId\n });\n } catch (e) {\n // Never throw back into Wix's analytics.\n }\n }\n\n // Wix doesn't replay earlier events to a late listener, so register as\n // soon as the stream exists.\n function register() {\n if (registered) return true;\n var wda = window.wixDevelopersAnalytics;\n if (!wda || typeof wda.register !== 'function') return false;\n try {\n wda.register(LISTENER_ID, onWixEvent);\n registered = true;\n } catch (e) {}\n return registered;\n }\n\n if (!register()) {\n try { window.addEventListener('wixDevelopersAnalyticsReady', register); } catch (e) {}\n var tries = 0;\n var timer = setInterval(function () {\n tries++;\n if (register() || tries > 300) clearInterval(timer);\n }, 100);\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
@@ -95,25 +95,6 @@
"value": "2"
}
]
- },
- {
- "accountId": "0",
- "containerId": "0",
- "variableId": "3",
- "name": "DLV - Wix Booking Page URL",
- "type": "v",
- "parameter": [
- {
- "type": "TEMPLATE",
- "key": "name",
- "value": "booking_page_url"
- },
- {
- "type": "INTEGER",
- "key": "dataLayerVersion",
- "value": "2"
- }
- ]
}
],
"fingerprint": "0",
diff --git a/skills/conversion-tracking/assets/snippets/README.md b/skills/conversion-tracking/assets/snippets/README.md
index c820d68..6393a34 100644
--- a/skills/conversion-tracking/assets/snippets/README.md
+++ b/skills/conversion-tracking/assets/snippets/README.md
@@ -74,7 +74,7 @@ Not every snippet fires on a confirmed success. Some tools expose no success sig
| `typeform.js` | Native success event | `form-submit` postMessage from an https `typeform.com` origin carrying `formId` and `responseId`, accepted only from a Typeform iframe on the page whose `/to/<formId>` address matches; once per form and response ID |
| `webflow-forms.js` | DOM-inferred after submit | submit on a form in `.w-form`, then within 30s `.w-form-done` becomes visible, or Webflow's own form state shows a redirect with `success === true` (checked on jQuery `ajaxComplete`); a newly shown `.w-form-fail` or the timeout cancels, and a resubmit replaces the pending watch |
| `wix-forms.js` | DOM-inferred after submit | click on a current Wix form's `[data-hook="submit-button"]`, then within 60s Wix's own thank-you message (`[data-hook="submit-form-success-message"]`) is added inside that form; a second click refreshes the same watch. Older Wix contact forms and forms set to redirect after submit are not covered |
-| `wix-scheduling.js` | DOM-inferred after submit | Book Now click stored in localStorage, then the `ThankYouPageAppDataHook.root` confirmation page renders within 10 minutes |
+| `wix-scheduling.js` | Native success event | `Purchase` from Wix's site analytics stream (`window.wixDevelopersAnalytics.register`) on the Thank You page, counted only when a line item's `catalogReference.appId` is Wix Bookings (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`), so Wix Stores orders on the same page don't count; once per order ID, pushed as `booking_id`. Wix doesn't replay the event to a late listener, so load the snippet on every page. Wix sends it a few seconds after the Thank You page loads (3 to 13.5 seconds in testing), so a visitor who leaves sooner isn't counted |
| `wpforms.js` | Native success event (AJAX); DOM-inferred after submit (non-AJAX) | jQuery `wpformsAjaxSubmitSuccess` followed by a new `#wpforms-confirmation-<id>` node (once per node), or `wpformsAjaxSubmitBeforeRedirect`; non-AJAX: leaving the page within 10s of submit with no client validation errors stores a sessionStorage marker, then within 120s the next page shows `#wpforms-confirmation-<id>` or a different path, with no `.wpforms-error` / `[aria-invalid]` markers |
| `ws-form.js` | Native success event | jQuery `wsf-submit-success` on a `form.wsf-form` with a numeric form ID; repeats for the same form and instance within 2s count once |
| `phone-click.js` | Submit/click-based best effort | click on an `a[href^="tel:"]` (call intent, not a completed call) |
diff --git a/skills/conversion-tracking/assets/snippets/wix-scheduling.js b/skills/conversion-tracking/assets/snippets/wix-scheduling.js
index 894d8d0..2af556a 100644
--- a/skills/conversion-tracking/assets/snippets/wix-scheduling.js
+++ b/skills/conversion-tracking/assets/snippets/wix-scheduling.js
@@ -6,169 +6,73 @@
window.__ctDetectWixScheduling = true;
window.dataLayer = window.dataLayer || [];
- // The booking CTA's Wix-controlled data-hook (app-level, theme-stable).
- var BOOK_NOW_HOOK = 'booking-details-book-now-cta';
- // The order-confirmation page's Wix-controlled marker (slug-independent).
- var THANKYOU_HOOK = 'ThankYouPageAppDataHook.root';
-
- // localStorage key for the cross-page marker. Deliberately distinct from
- // the production loader's key so this recipe never collides with it.
- var STASH_KEY = '__cvlyRecipeWixSchedStash';
- // How long a click-marker stays valid. The form→confirmation navigation
- // is immediate for free services; generous to absorb slow networks and
- // (best-effort) a paid service's checkout step.
- var STASH_TTL_MS = 10 * 60 * 1000; // 10 minutes
- // How long, on a given page load, we wait for the confirmation marker to
- // render (Wix boots its widgets asynchronously) before giving up.
- var THANKYOU_WAIT_MS = 12000;
-
- function now() {
- return Date.now();
- }
-
- function writeStash(obj) {
+ // Wix Bookings checks out through Wix eCommerce. Once the order exists,
+ // the shared Thank You page reports a Purchase through Wix's own site
+ // analytics stream (window.wixDevelopersAnalytics). Its line items name
+ // the Wix app that sold them, so a booking is an item from Wix Bookings
+ // and a Wix Stores order is not. Only the event name, the line items'
+ // app IDs and the order ID are read, never the buyer's details.
+ var BOOKINGS_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
+ var LISTENER_ID = 'ctRecipeWixScheduling';
+ var seen = {};
+ var registered = false;
+
+ function isBookingsItem(item) {
try {
- window.localStorage.setItem(STASH_KEY, JSON.stringify(obj));
+ return !!item && typeof item === 'object' && !!item.catalogReference &&
+ item.catalogReference.appId === BOOKINGS_APP_ID;
} catch (e) {
- // Private mode / storage disabled — can't bridge the navigation, so
- // the booking simply won't be tracked. Fail quietly.
- }
- }
-
- function readStash() {
- try {
- var raw = window.localStorage.getItem(STASH_KEY);
- if (!raw) return null;
- var obj = JSON.parse(raw);
- return (obj && typeof obj === 'object') ? obj : null;
- } catch (e) {
- return null;
+ return false;
}
}
- function clearStash() {
- try { window.localStorage.removeItem(STASH_KEY); } catch (e) {}
- }
-
- function isFreshStash(stash) {
- return !!(stash && typeof stash.ts === 'number' && (now() - stash.ts) <= STASH_TTL_MS);
- }
-
- function fireConversion(bookingId, pageUrl) {
- var payload = {
- event: 'wix_appointment_scheduled',
- booking_page_url: pageUrl || ''
- };
- if (bookingId) payload.booking_id = bookingId;
- window.dataLayer.push(payload);
+ function orderIdOf(params) {
+ var id = params.orderId;
+ if (typeof id !== 'string' || !id) id = params.id;
+ return typeof id === 'string' && /^[A-Za-z0-9-]{1,64}$/.test(id) ? id : '';
}
- // ---- Booking form page: mark the Book Now click ----
- //
- // Simplification vs. the production module: because this recipe never
- // reads or reports form field values, it doesn't need to locate the
- // specific booking-form widget on the page (the source module climbs the
- // DOM to scope a field walk to the correct form) — matching on the
- // Wix-controlled CTA hook alone is enough to know a booking attempt was
- // made.
- function handleClick(event) {
+ function onWixEvent(name, params) {
try {
- var target = event.target;
- if (!target || !target.closest) return;
-
- var btn = target.closest('[data-hook="' + BOOK_NOW_HOOK + '"]');
- if (!btn) return;
-
- writeStash({
- // The page where the booking was submitted — the meaningful
- // pageUrl for the conversion (the confirmation page's URL carries
- // only a random booking UUID).
- pageUrl: window.location.pathname,
- ts: now()
+ if (name !== 'Purchase' || !params || typeof params !== 'object') return;
+ var items = params.contents;
+ if (!items || typeof items.length !== 'number') return;
+ var booking = false;
+ for (var i = 0; i < items.length; i++) {
+ if (isBookingsItem(items[i])) { booking = true; break; }
+ }
+ if (!booking) return;
+ var orderId = orderIdOf(params);
+ if (!orderId || seen[orderId]) return;
+ seen[orderId] = true;
+ window.dataLayer.push({
+ event: 'wix_appointment_scheduled',
+ booking_id: orderId
});
} catch (e) {
- // Never throw back into Wix's own click handling.
- }
- }
-
- // ---- Confirmation page: fire on the success marker ----
-
- function isThankYouPage() {
- try {
- return !!document.querySelector('[data-hook="' + THANKYOU_HOOK + '"]');
- } catch (e) {
- return false;
+ // Never throw back into Wix's analytics.
}
}
- function extractBookingId() {
- try {
- var m = window.location.pathname.match(
- /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i
- );
- return m ? m[0] : null;
- } catch (e) {
- return null;
- }
- }
-
- function fireFromThankYou() {
- // Consume-first idempotency: the stash is the single source of truth.
- // Clearing it before firing means a second call (observer + immediate
- // check racing) is a no-op.
- var stash = readStash();
- if (!stash) return;
- if (!isFreshStash(stash)) { clearStash(); return; }
-
- clearStash(); // consume before firing so re-entry can't double-fire
-
- fireConversion(extractBookingId(), stash.pageUrl);
- }
-
- // Runs at load on EVERY page. If a fresh booking marker exists and this
- // page is the confirmation page, fire. If the page hasn't rendered the
- // marker yet (Wix boots widgets async), watch for it within a bounded
- // window. On non-confirmation pages the watcher simply times out and
- // disconnects — harmless.
- function maybeFireOnThankYou() {
- var stash = readStash();
- if (!stash) return;
- if (!isFreshStash(stash)) { clearStash(); return; }
-
- if (isThankYouPage()) { fireFromThankYou(); return; }
-
- var done = false;
- var observer = null;
- var timer = null;
-
- function cleanup() {
- done = true;
- if (observer) { try { observer.disconnect(); } catch (e) {} observer = null; }
- if (timer) { clearTimeout(timer); timer = null; }
- }
-
- function check() {
- if (done) return;
- if (isThankYouPage()) {
- cleanup();
- fireFromThankYou();
- }
- }
-
+ // Wix doesn't replay earlier events to a late listener, so register as
+ // soon as the stream exists.
+ function register() {
+ if (registered) return true;
+ var wda = window.wixDevelopersAnalytics;
+ if (!wda || typeof wda.register !== 'function') return false;
try {
- observer = new MutationObserver(check);
- observer.observe(document.documentElement || document.body, {
- childList: true,
- subtree: true
- });
- } catch (e) {
- // MutationObserver unavailable — the immediate check above already ran.
- }
- timer = setTimeout(cleanup, THANKYOU_WAIT_MS);
+ wda.register(LISTENER_ID, onWixEvent);
+ registered = true;
+ } catch (e) {}
+ return registered;
}
- if (typeof document !== 'undefined' && document.addEventListener) {
- document.addEventListener('click', handleClick, true); // booking form
- maybeFireOnThankYou(); // confirmation page
+ if (!register()) {
+ try { window.addEventListener('wixDevelopersAnalyticsReady', register); } catch (e) {}
+ var tries = 0;
+ var timer = setInterval(function () {
+ tries++;
+ if (register() || tries > 300) clearInterval(timer);
+ }, 100);
}
})();