Skill Tracer
Skills › Marketing Skills › conversion-tracking › detect-wix-scheduling.json

detect-wix-scheduling.json

103 lines · skills/conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json at 88c79f6

1{
2 "exportFormatVersion": 2,
3 "exportTime": "2026-07-02 00:00:00",
4 "containerVersion": {
5 "path": "accounts/0/containers/0/versions/0",
6 "accountId": "0",
7 "containerId": "0",
8 "containerVersionId": "0",
9 "container": {
10 "path": "accounts/0/containers/0",
11 "accountId": "0",
12 "containerId": "0",
13 "name": "Conversion Detection - Wix Scheduling",
14 "publicId": "GTM-XXXXXXX",
15 "usageContext": [
16 "WEB"
17 ],
18 "fingerprint": "0",
19 "tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
20 },
21 "tag": [
22 {
23 "accountId": "0",
24 "containerId": "0",
25 "tagId": "1",
26 "name": "Conversion Detection - Wix Scheduling Booking Listener",
27 "type": "html",
28 "parameter": [
29 {
30 "type": "TEMPLATE",
31 "key": "html",
32 "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>"
33 },
34 {
35 "type": "BOOLEAN",
36 "key": "supportDocumentWrite",
37 "value": "false"
38 }
39 ],
40 "firingTriggerId": [
41 "2147479553"
42 ],
43 "tagFiringOption": "ONCE_PER_EVENT",
44 "monitoringMetadata": {
45 "type": "MAP"
46 },
47 "consentSettings": {
48 "consentStatus": "NOT_SET"
49 }
50 }
51 ],
52 "trigger": [
53 {
54 "accountId": "0",
55 "containerId": "0",
56 "triggerId": "2",
57 "name": "CE - Wix Appointment Scheduled",
58 "type": "CUSTOM_EVENT",
59 "customEventFilter": [
60 {
61 "type": "EQUALS",
62 "parameter": [
63 {
64 "type": "TEMPLATE",
65 "key": "arg0",
66 "value": "{{_event}}"
67 },
68 {
69 "type": "TEMPLATE",
70 "key": "arg1",
71 "value": "wix_appointment_scheduled"
72 }
73 ]
74 }
75 ],
76 "filter": []
77 }
78 ],
79 "variable": [
80 {
81 "accountId": "0",
82 "containerId": "0",
83 "variableId": "1",
84 "name": "DLV - Wix Booking ID",
85 "type": "v",
86 "parameter": [
87 {
88 "type": "TEMPLATE",
89 "key": "name",
90 "value": "booking_id"
91 },
92 {
93 "type": "INTEGER",
94 "key": "dataLayerVersion",
95 "value": "2"
96 }
97 ]
98 }
99 ],
100 "fingerprint": "0",
101 "tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
102 }