/adsPaid ads
Sets campaign structure, budget and targeting on Google, Meta and more.
Sets up and verifies conversions in Google Ads, Meta and GA4.
$ npx skills add coreyhaines31/marketingskills --skill conversion-trackingOpen your project folder in a terminal and paste this. Claude then uses the skill when a task calls for it. Add -g to install it for every project.
The original as published on GitHub. The summary above is Velin's.
You help people set up conversion tracking that provably works, or find out exactly why their existing tracking doesn't. Everything you recommend should be fitted to what they actually run and where the data needs to go, and every finding you report should say how you learned it.
One rule sits above everything else here. If a test conversion can safely be fired, the job isn't done until one demonstrably arrived. And if it can't be fired, say plainly what remains unverified rather than implying it all works.
There are two kinds of conversions, and they break in completely different ways.
Lead generation covers things like a form being submitted, a meeting being booked, a chat being started, or a phone number being called. The tricky part is that the browser is often the only place these moments are reliably visible. Many sites have no backend record of "contact form submitted" (some do, through a form tool's webhook or the site's own backend, and those are worth using), so success usually has to be worked out from a signal in the page, and every form and booking tool signals success differently. Getting that signal wrong is the single most common cause of tracking that looks fine but is quietly wrong. Fire on the submit button and you count failed submissions and bots. Fire on a thank-you page and you count refreshes.
Ecommerce covers purchases and subscriptions. Here the hard part of lead gen simply doesn't exist, because an order record does. The store knows a purchase happened, so knowing the conversion is real is nearly free. The difficulty moves elsewhere instead. Is the value right (tax and shipping in or out, and in which currency)? Does the item data match the merchant feed? Are the browser pixel and the server event deduplicated so each sale counts once? Are the pre-purchase events (view item, add to cart, begin checkout) flowing, since that's what the platforms optimise on? And what happens when an order is refunded?
Work out which side of this line you're on before doing anything else. It decides which reference files apply, which failure modes to suspect, and which delivery options even make sense.
| The user's opening move | What to do |
|---|---|
| Nothing set up yet | Run the setup flow below |
| Something exists and it's misbehaving | Run the audit flow below |
| Something exists and they don't know if it works | Run the audit flow as a verification pass. There's no symptom to route on, so do the full evidence sweep |
| "Should we go server-side?" or "Is tool X worth it?" | Go straight to references/server-side.md and answer the question with the real options and real numbers. Don't put a decision question through a setup wizard |
| "Just give me the snippet for tool X" | Read assets/snippets/{tool}.js and hand over its contents verbatim, header included. Never retype or condense a snippet from memory, because the shipped file carries edge cases a rewrite silently drops. Name the dataLayer event it pushes and offer the one-minute console check. No interrogation first |
Setup and audit both run on the same three facts. In setup you're establishing them so you can build. In an audit you're establishing them so you know what should be true before you go looking at what is.
1. What counts as a conversion? Be precise here, because most people haven't actually decided. A confirmed form submission is not a click on the submit button, and a purchase is not someone starting checkout. Does a newsletter signup count? Are a quote request and a contact form one conversion or two? Settling this is the first place you add value, before any code gets touched. And ask whether the conversion that actually matters sits further down the funnel, a qualified lead or a closed deal only the CRM knows about. That has its own path and its own volume gates, covered in references/server-side.md under tracking what happens after the lead.
2. Where does it need to land? GA4 only, one ad platform, or several? This matters because it decides how much the lead's details (email, phone, name) matter. Ad platforms bid real money on these numbers and match on the lead's details, so the stakes are highest there. But an analytics-only setup still loses some conversions to ad blockers and the like (typically 10–30% depending on audience; magnitudes are in references/discrepancies.md), so server-side is worth mentioning for more accurate numbers even when no ad platform is involved.
3. What runs the moment? Which form, booking, chat, or checkout tool, what the site is built on, and whether Google Tag Manager is installed.
Look before you ask. Try to answer these three questions from evidence first, and only ask about what's left, in a single batched message. If .agents/product-marketing.md exists (or .claude/product-marketing.md, or the legacy product-marketing-context.md), read it first, since it often names the site platform, the CRM, and the ad channels. If you have the site's URL, fetch the page and read what already runs on it (existing tags, a GTM container ID, the consent banner, the form or cart tool). If you have the codebase, search it for form handlers and tracking calls. If you have access to the GTM container or the ad account, read it. A skill that interrogates the user for facts it could have observed is a wizard, not an agent.
There's one question you should always ask though, because no amount of page inspection can answer it. Is anything already sending conversions from a server or a native integration? Think Meta's Conversions API, a Shopify or HubSpot native channel, server-side GTM, offline uploads, or a Zapier job. None of these leave any trace in the page source, so a page with no visible tag can still be fully tracked. This matters in both directions. Never conclude tracking is missing just because you can't see it, and never add a new sender without knowing what's already sending, because a second sender is how double counting starts.
Step 1. Pin the three facts. Do the recon described above first, then ask one batched question covering whatever's left. If tags already exist on the site, switch into audit thinking before adding anything, because the classic setup failure is a second pixel or a second container quietly double counting everything the first one does.
Step 2. Work out how the moment signals success.
For lead gen, look the tool up in references/conversion-moments.md and find its real success signal. Every tool is different (a jQuery event, a DOM event, an embed callback, a redirect), and hooking the wrong one silently tracks attempts instead of outcomes. For a custom-coded form, open the submit handler and read it, because the most common silent failure on custom sites is a success branch with no tracking call in it at all. And if the moment is something only the backend knows about (an account created, a lead received by an API), then no browser event exists to detect, and the send has to come from the server. That doesn't only mean building it yourself. The options for a server-originated send run from your own build against the platform APIs to managed tools with a server-side API and SDK that pair the backend event with the browser's click IDs; they're in references/server-side.md. And for a moment with no form tool at all, like a phone call or a download, the universal patterns in the assets are the primary answer, not a fallback. Where the free path has a structural ceiling (a cross-origin iframe, whose submission the shipped snippets can often detect but whose lead details stay locked inside it, a checkout on someone else's domain, a moment only a backend knows), say so plainly and name the paths that get past it: the tool's own webhook or native integration (into Meta CAPI, or into Google Ads passing the gclid, as Google matches email only if its tag saw it), a managed tool, or a server-side send. No amount of tag work clears a structural ceiling.
For ecommerce, the order record is the source of truth, so use the platform's own confirmed-order surface rather than rebuilding the inference. On Shopify that means web pixels or a native channel. On WooCommerce it means the server-side order hooks. Platform specifics, including which older methods no longer work, are in references/ecommerce-platforms.md.
This is also the moment to push back on anti-patterns before building them. The common ones are button clicks tracked as conversions (that's intent, not an outcome), pricing-page views set up as Primary conversions (which teaches the bidding algorithm to buy browsers rather than buyers), the same real-world action counted by two different conversion actions, and lead forms set to count Every conversion instead of One. If the user still wants a soft signal tracked after hearing why it's a problem, set it up as Secondary so it never drives bidding, and tell them that's what you did.
Step 3. Choose the delivery path. This is a decision made on stated criteria, not a default.
references/discrepancies.md). Ad blockers stop the tag firing at all, Safari's cookie limits erase the click ID before many people come back to convert, and cross-device journeys (the ad clicked on a phone, the form filled on a laptop) leave the converting browser with no click ID to report. And a default tag carries little to match on: the click ID from its cookie, the IP address, and the user agent. The free fix comes first. Browser tags can send hashed email and phone too: Google's Enhanced Conversions for web (the Google tag, or GTM's user-provided data variable), Meta's automatic and manual advanced matching, and TikTok's ttq.identify. Turn these on before anything paid. This skill's snippets send no personal data, so the identity piece is configured on the tag. The two problems are linked, because identity data is what lets a platform tie a cross-device or expired-cookie conversion back to the person who clicked, and browser-sent identity data rides the same blocker and cookie losses as the tag itself. Visitors who decline tracking are a separate case. No method counts them, server-side included, and none should, so never present consent as a loss any tool recovers. For analytics-only destinations the match-data half doesn't apply, since analytics tools take no personal data, but server-side still recovers the conversions lost to ad blockers and gives more accurate numbers, so present it as an option there too. Don't tell an analytics-only user the loss doesn't matter. Their reports still undercount, even when no bidding depends on them.references/server-side.md. Present the options that fit. Never present one answer.One rule ties these together. When the user is choosing a delivery path, or the browser-side loss bears on their question, say in a sentence that server-side paths exist and where the options are, so they can choose. Don't append tool names or prices to a setup, audit fix, or snippet request that didn't ask about delivery; give the detail when they ask or reach the delivery decision. An ad-platform setup reaches that decision when the user mentions ad blockers, iOS or ATT signal loss, or conversions the platform is missing or under-reporting; then walk through the options in references/server-side.md, free and native paths first. Server-side matters less in a short testing phase, for Google Ads only with Enhanced Conversions on and few ad blockers in the audience, or when Meta advanced matching is on and blockers are the only gap left. And when you compare paths, compare on the dimensions that actually differ, not just price: what data travels with the conversion (an event alone, or the lead's identity and click IDs, which is what match quality and Enhanced Conversions run on), whether delivery is observable (a per-conversion log, or silence when it breaks), and who can do the setup (agent-driveable in minutes, or a build someone owns).
Step 4. Build it. The platform mechanics live in references/google-ads.md, references/meta.md, references/other-platforms.md, and references/browser-side.md. For GTM builds on a covered lead-gen tool, prefer generating the import file rather than hand-building tags:
python3 scripts/build_recipe.py --tool {tool} --send {platform} --{ids}
That produces one file bundling the detection listener, the custom event trigger, the Conversion Linker, and the conversion tag, all wired together. The user imports it with MERGE and reviews the diff in Preview before anything goes live. General GTM craft (naming, workspaces, debugging) is covered by the analytics skill, so don't duplicate it.
Consent comes before the first tag. The recipes' ad tags need ad_storage consent (GA4 analytics_storage), so where a banner defaults to denied they wait for consent. If the site serves the EEA, UK, or other consent-regulated regions, confirm its consent setup before importing, and never strip the requirements to force a tag. Details in assets/gtm-recipes/README.md.
Step 5. Verify. See "Verification discipline" below. A setup without a verified arrival, or at least a named handover check for the parts you can't reach, isn't finished.
Step 6. Hand over. Close with what was built and where, the IDs used, the event names in play, how to re-verify the whole thing in five minutes, the delivery loss to expect for their traffic profile (and, if that loss matters for their goals, that server-side options exist in references/server-side.md), and what's likely to break it later (a form plugin update, a consent banner change, a platform deprecation that's already been announced).
Route on the symptom, in the user's own words, using the table below. Then gather evidence in this order. Static recon of the page and the published container first, then classify how the conversion moment fires, then walk the click ID chain, then guided account checks. The full evidence procedure, the scoring, and the report template are in references/audit-playbook.md, which uses the same scoring rules as the ads skill's audit guardrails. The short version of those rules is that every check resolves to pass, fail, unknown, or not applicable, and an unknown reduces your evidence coverage but never counts against the account's health, because "I couldn't check your pixel" and "your pixel is broken" are different findings.
| Symptom | Suspect first |
|---|---|
| "Never tracked anything" | A missing or mis-wired tag. Recon the page, then classify the moment |
| "It was working and then stopped" | Date the breakage, then check the platform calendar below. Ask what changed that week |
| "Spend and clicks, but zero conversions" | The click ID chain, link by link |
| "GA4 and Google Ads don't match" | Usually nothing. Read the verdict rules below before digging |
| "Way too many conversions" | Duplicate senders (a pixel and a server event without shared event IDs, or a tag and a GA4 import both set to Primary), Every-versus-One counting, or thank-you page refreshes |
| "Leads in my inbox, but the platform shows nothing" | A capture gap. Classify the moment, then walk the click ID chain |
| "Conversions record, but Smart Bidding ignores them" | Account settings. Primary versus Secondary, Include in Conversions, and the campaign's goal setup |
| "Some conversions come through, nowhere near all" | Inventory every entry point before any verdict, then look at structural loss |
| "Ads reports leads, but sales says they're junk" | The wrong moment. It's probably firing on clicks or validation rather than confirmed success |
| "The conversion is in GA4, but the campaign gets no credit" | Attribution loss. The click ID chain first |
| "The revenue numbers are wrong" (ecommerce) | Value integrity. Tax and shipping in or out, currency, and refunds never being adjusted |
| "Meta ROAS looks way better than Google" (ecommerce) | Attribution windows differ between the two, and refunds only exist on one side. Google Ads supports conversion adjustments and Meta documents no refund mechanism, so stores with high return rates structurally inflate Meta |
| "Plenty of leads, but the ads aren't producing actual customers" | The ads are optimising on form fills, not outcomes. The fix is feeding CRM outcomes back: value-based bidding on the lead, or deal-stage imports where the volume supports it. references/server-side.md, tracking what happens after the lead |
The platform calendar. Tracking that "just stopped" increasingly has a dated, platform-wide cause, so check the calendar before starting a deep dive. The current ones worth knowing about are these. Shopify removed Additional Scripts from the Thank you and Order status pages for all remaining stores on 26 August 2026 (Plus stores went through it on 28 August 2025, and storefront script tags follow on 1 March 2027). And WooCommerce's Blocks checkout doesn't fire the classic hooks that many tracking plugins depend on, so tracking often dies in a checkout redesign. Details and fixes for both are in references/ecommerce-platforms.md.
Apply these before reporting anything, especially on the "numbers don't match" symptom.
references/discrepancies.md.Verification is the audit's evidence standard applied at the end of a setup, and partial access is the normal situation, not the exception. You can usually observe the browser half yourself. You almost never have the user's ad account login, so the platform half usually runs through them.
Every tool named in this skill's references appears alongside its real alternatives, with current prices, honest effort and lead-time costs, and the free or native path always stated. One entry in references/server-side.md is marked as a partner of this repository. That marker is disclosure, not endorsement, and the fit criteria are the same for every row. The standing test is simple. If a recommendation wouldn't survive swapping the named tool for its nearest competitor, it doesn't belong here.
Two practical rules when a tool from the spectrum comes up in your answer. If it's a partner-marked tool, carry the disclosure into the answer in the same breath, because the disclosure lives in the reference file and the user only ever reads your answer. That applies to any answer that names it, even in passing or as one example in a list ("managed tools like X or Y"); once per answer is enough. The wording is "a Verified Partner of the repository this skill comes from". Use it exactly as written, as a short phrase, and don't recite the reasoning behind it. And if you lean toward any one option, name its nearest alternative alongside it, so the user is choosing rather than accepting.
And one rule that prevents underselling the options from memory. Before telling a user that no server-side path exists for their moment, tool, or destination, check references/server-side.md. Between them, native integrations, direct platform APIs, server-side GTM, webhook and CRM sync tools, and managed tools cover most moments, including iframes, bookings, chats, and backend-confirmed events. If you can't confirm a specific tool is covered, say so and point the user to that vendor's own integration list, rather than implying it isn't covered.
Load a reference when the task reaches it. Nothing here is optional reading, it's just split out so this file stays navigable.
| Task | Load |
|---|---|
| How each form, booking, chat, and checkout tool signals success | references/conversion-moments.md |
| Pixels, tags, and GTM builds, the complete browser-side path | references/browser-side.md |
| Server-side, the options spectrum with prices and honest tradeoffs | references/server-side.md |
| Shopify, WooCommerce, and other store platforms, including the deprecation dates | references/ecommerce-platforms.md |
| Google Ads setup, statuses, the gclid lifecycle, Enhanced Conversions, and its failure catalog | references/google-ads.md |
| Meta setup, CAPI, deduplication, match quality, and its failure catalog | references/meta.md |
| LinkedIn, TikTok, Microsoft, and the rest | references/other-platforms.md |
| The audit's evidence procedure, scoring, and report template | references/audit-playbook.md |
| Why the numbers never match, loss magnitudes, and the refund asymmetry | references/discrepancies.md |
Assets: assets/snippets/ holds paste-in success detectors for 22 lead-gen tools, plus four universal patterns for the moments no form tool owns: phone call clicks (the most under-tracked conversion in local services), file downloads, thank-you page arrivals, and a generic AJAX success pattern. assets/gtm-recipes/ holds the importable GTM containers (detection and send, with event names in event-map.json), and scripts/build_recipe.py merges them with the user's IDs into one import file.
Importable Google Tag Manager containers that produce one import-ready file per tool and destination, no manual tag building (26 detectors x 6 destinations).
detect/ (26 recipes, ready to import as-is). Each contains a listener tag that detects one tool's conversion moment (form submitted, meeting booked) and pushes a canonical dataLayer event, plus a custom event trigger on that event and dataLayer variables for the form or booking ID. The event names are listed in ../snippets/README.md and in event-map.json.
send/ (6 templates, need values filled in before import). Each contains the tag that actually records the conversion, wired to a placeholder trigger:
send/google-ads.json - a Google Ads conversion tag plus a Conversion Linker tag. Tokens to replace: __GOOGLE_ADS_CONVERSION_ID__ (digits only, drop the AW- prefix), __GOOGLE_ADS_CONVERSION_LABEL__, __DETECTION_EVENT__, __RECIPE_LABEL__. It sends no conversion value or currency, so Google Ads falls back to the conversion action's default value. For value-based bidding (Maximize conversion value, tROAS), open the tag after import and fill Conversion Value and Currency Code (a fixed value like 150 and USD, or a dataLayer variable), or add { "type": "TEMPLATE", "key": "conversionValue", "value": "150" } and { "type": "TEMPLATE", "key": "currencyCode", "value": "USD" } to the tag's parameter list before import.send/ga4.json - a GA4 event tag. Tokens to replace: __GA4_MEASUREMENT_ID__, __GA4_EVENT_NAME__ (use generate_lead unless the user has a naming scheme), __DETECTION_EVENT__, __RECIPE_LABEL__. It assumes a GA4 tag already runs on the site. This template only sends the conversion event, so it cannot double-count pageviews.../../scripts/build_recipe.py merges a detect recipe and a send template into ONE importable file with the user's IDs injected:
python3 ../../scripts/build_recipe.py --tool gravity-forms --send google-ads \
--conversion-id 123456789 --conversion-label AbCdEfGhIj -o import-me.json
If you are an AI agent using this repo: collect the user's IDs first (the setup references in ../../references/ show exactly where each ID lives in each platform's UI), run the script, and hand the user the single output file with these import instructions. In Google Tag Manager go to Admin, then Import Container, choose the file, pick your existing workspace, and choose MERGE. Then Preview to test, and Publish.
No Python available? Do the merge by hand: import the detect recipe as-is, then open the send template, replace every __TOKEN__, set its trigger's arg1 value to the tool's event name, and import it into the same workspace with MERGE.
Every tag in send/ ships with GTM's Additional consent checks set to "Require additional consent for tag to fire" (consentStatus: NEEDED in the JSON):
| Tag | Required consent types |
|---|---|
| Google Ads Conversion | ad_storage |
| Conversion Linker | ad_storage |
| GA4 Event | analytics_storage |
| Meta, TikTok, LinkedIn, Microsoft base tags and conversion tags | ad_storage |
The Google Ads conversion tag doesn't require ad_user_data or ad_personalization, because measuring a conversion isn't ad personalisation, a visitor who accepts ad cookies but declines personalised ads should still count, and Google's tag applies its own checks for those two types.
The detect listeners themselves stay NOT_SET: they only push a dataLayer event and set no cookies.
What happens with and without a consent setup. These checks read the consent state that a consent management platform (CMP) sets through Google Consent Mode, normally from a tag on the Consent Initialization trigger. Google's consent API treats a consent type nobody has set as granted, and current gtm.js behaves the same way (checked October 2026). So on a site with no consent setup these tags fire, and where a banner sets a default of denied they're held until the visitor accepts. A held tag doesn't replay a conversion that happened before consent.
Base pixels fire on All Pages. When the visitor grants consent after the page has loaded, the base pixel does not retry by itself. Add a second firing trigger on your CMP's consent-update dataLayer event (for example cookie_consent_update) to the base tags so they load as soon as consent arrives.
To change it: in GTM open the tag, then Advanced Settings, then Consent Settings, and choose "No additional consent required" or edit the listed types. To change it before import, edit the tag's consentSettings in the JSON: {"consentStatus": "NOT_NEEDED"}, or NEEDED with a consentType list of {"type": "TEMPLATE", "value": "<consent type>"} items. Google's own tags (Google Ads, Conversion Linker, GA4) also have built-in consent checks, so a site running Consent Mode in advanced mode (cookieless pings before consent) can switch those three to "No additional consent required" and let Consent Mode handle them.
These recipes fire conversions from the visitor's browser. Ad blockers (a sizeable share of users), Safari's cookie limits, and consent rejections will silently drop a share of real conversions, and iframe-embedded tools plus multi-platform sending have structural limits. For the honest comparison of browser-side against server-side options, read ../../references/server-side.md.
The detection snippets and GTM recipes in this skill are adapted from the open-source ConversionKit conversion-tracking toolkit (MIT), maintained by the team behind Converly ◆, a Verified Partner of this repository. That team contributed them here under the same MIT license, with neutral naming.
{
"exportFormatVersion": 2,
"exportTime": "2026-10-15 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Acuity Scheduling",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Acuity Scheduling Booking Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n if (window.__ctDetectAcuity) return;\n window.__ctDetectAcuity = true;\n window.dataLayer = window.dataLayer || [];\n\n // Acuity's booking form gives the page no booking event of its own. This\n // listener pairs with a short snippet the site owner pastes into Acuity's\n // custom conversion tracking field (the field snippet that comes with this\n // listener). Acuity runs that snippet after each booking inside its\n // conversion tracking frame, on\n // https://conversion-tracking-sandbox.acuityinnovation.com, two frames below\n // this page, and it posts the booking's ID to this page only (it names the\n // page's own address as the target). The frame is a grandchild, so it can't\n // be matched to an iframe on the page; it must come from Acuity's origin and\n // sit inside this page's own frame tree.\n var ORIGIN_PATTERN = /^https:\\/\\/([a-z0-9-]+\\.)+acuityinnovation\\.com$/;\n var ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;\n var KIND_PATTERN = /^[A-Za-z_-]{1,32}$/;\n var PRICE_PATTERN = /^[0-9]{1,9}(\\.[0-9]{1,4})?$/;\n var seenIds = [];\n\n function isPlainObject(value) {\n return !!value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]';\n }\n\n // A frame inside this page has this page as its top window. A popup or a\n // window this page opened does not.\n function insideThisPage(source) {\n try { return source.top === window; } catch (e) { return false; }\n }\n\n function idSeen(id) {\n for (var i = 0; i < seenIds.length; i++) if (seenIds[i] === id) return true;\n return false;\n }\n\n function cleanText(value, max) {\n if (typeof value !== 'string') return '';\n value = value.replace(/[\\u0000-\\u001f\\u007f]/g, ' ').replace(/^\\s+|\\s+$/g, '');\n return value.length > max ? value.slice(0, max) : value;\n }\n\n function onMessage(message) {\n if (!message || !message.source || message.source === window) return;\n if (typeof message.origin !== 'string' || !ORIGIN_PATTERN.test(message.origin)) return;\n if (!insideThisPage(message.source)) return;\n var data = message.data;\n if (!isPlainObject(data) || data.source !== 'gtm-acuity-booking' || data.version !== 1) return;\n if (typeof data.appointment_id !== 'string' || !ID_PATTERN.test(data.appointment_id)) return;\n if (idSeen(data.appointment_id)) return;\n var push = { event: 'acuity_appointment_scheduled', appointment_id: data.appointment_id };\n if (typeof data.kind === 'string' && KIND_PATTERN.test(data.kind)) push.acuity_type = data.kind;\n var type = cleanText(data.appointment_type, 200);\n if (type) push.appointment_type = type;\n if (typeof data.price === 'string' && PRICE_PATTERN.test(data.price)) push.price = data.price;\n // The ID is remembered only once the push went through, so a dataLayer\n // that throws (a broken wrapper) never escapes into the page, and a\n // repeat of the same message can still be counted.\n try {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(push);\n } catch (e) {\n return;\n }\n seenIds.push(data.appointment_id);\n }\n\n window.addEventListener('message', onMessage, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Acuity Appointment Scheduled",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "acuity_appointment_scheduled"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Acuity Appointment ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "appointment_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "2",
"name": "DLV - Acuity Type",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "acuity_type"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "3",
"name": "DLV - Acuity Appointment Type",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "appointment_type"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "4",
"name": "DLV - Acuity Price",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "price"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/versions/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-10-15 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Cal.com",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Cal.com Booking Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n if (window.__ctDetectCalcom) return;\n window.__ctDetectCalcom = true;\n window.dataLayer = window.dataLayer || [];\n\n // Cal.com's embed code (inline, popup and floating button) renders an iframe\n // from https://app.cal.com; a booking page pasted in as a plain iframe loads\n // from https://cal.com. Each posts from its own origin, so a frame is only\n // trusted for the origin its address starts with. The CSS selectors do that\n // prefix match so this listener never reads an iframe's address, because\n // Cal.com prefill parameters can carry a name or email.\n var CAL_FRAMES = [\n { selector: 'iframe[src^=\"https://app.cal.com/\"]', origin: 'https://app.cal.com' },\n { selector: 'iframe[src^=\"https://cal.com/\"]', origin: 'https://cal.com' }\n ];\n var UID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;\n var STATUS_PATTERN = /^[A-Z_]{1,32}$/;\n var trackedFrames = [];\n var seenUids = [];\n\n function trackFrame(frame, origin) {\n if (!frame || !frame.contentWindow) return;\n for (var i = 0; i < trackedFrames.length; i++) {\n if (trackedFrames[i].frame === frame) {\n trackedFrames[i].origin = origin;\n return;\n }\n }\n trackedFrames.push({ frame: frame, origin: origin });\n }\n\n function scan(root) {\n if (!root || typeof root.querySelectorAll !== 'function') return;\n for (var k = 0; k < CAL_FRAMES.length; k++) {\n var frames;\n try { frames = root.querySelectorAll(CAL_FRAMES[k].selector); } catch (e) { continue; }\n for (var i = 0; i < frames.length; i++) trackFrame(frames[i], CAL_FRAMES[k].origin);\n }\n }\n\n // The message must come from a Cal.com frame that is on this page right now,\n // and from the origin that frame was loaded from. Cal.com re-creates popup\n // frames, so a frame seen earlier is re-checked live.\n function sourceIsTracked(message) {\n for (var i = 0; i < trackedFrames.length; i++) {\n var item = trackedFrames[i];\n try {\n if (item.frame.isConnected === true && item.frame.contentWindow === message.source && item.origin === message.origin) return true;\n } catch (e) { /* replaced or inaccessible frames fail closed */ }\n }\n return false;\n }\n\n function isCalOrigin(origin) {\n for (var k = 0; k < CAL_FRAMES.length; k++) if (CAL_FRAMES[k].origin === origin) return true;\n return false;\n }\n\n function isPlainObject(value) {\n return !!value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]';\n }\n\n function uidSeen(uid) {\n for (var i = 0; i < seenUids.length; i++) if (seenUids[i] === uid) return true;\n return false;\n }\n\n function onMessage(message) {\n if (!message || !message.source || message.source === window) return;\n if (!isCalOrigin(message.origin)) return;\n // A frame added since the last scan (a popup that just opened) is picked up here.\n if (!sourceIsTracked(message)) {\n scan(document);\n if (!sourceIsTracked(message)) return;\n }\n var data = message.data;\n if (typeof data === 'string') {\n try { data = JSON.parse(data); } catch (e) { return; }\n }\n // Only a completed new booking. Reschedules (rescheduleBookingSuccessfulV2)\n // and the deprecated V1 events, which carry the attendee's details, never match.\n if (!isPlainObject(data) || data.originator !== 'CAL' || data.type !== 'bookingSuccessfulV2') return;\n var booking = data.data;\n if (!isPlainObject(booking) || typeof booking.uid !== 'string' || !UID_PATTERN.test(booking.uid)) return;\n if (uidSeen(booking.uid)) return;\n // Only these three values are copied. The booking title names the attendee,\n // so it and every other field are left behind.\n var push = { event: 'calcom_booking_successful', booking_uid: booking.uid };\n if (typeof booking.eventTypeId === 'number' && isFinite(booking.eventTypeId)) push.event_type_id = String(booking.eventTypeId);\n if (typeof booking.status === 'string' && STATUS_PATTERN.test(booking.status)) push.booking_status = booking.status;\n // The ID is remembered only once the push went through, so a dataLayer\n // that throws (a broken wrapper) never escapes into the page, and a\n // repeat of the same message can still be counted.\n try {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(push);\n } catch (e) {\n return;\n }\n seenUids.push(booking.uid);\n }\n\n function start() {\n if (typeof document === 'undefined') return;\n scan(document);\n if (typeof MutationObserver === 'undefined' || !document.documentElement) return;\n try {\n var observer = new MutationObserver(function (mutations) {\n for (var i = 0; i < mutations.length; i++) {\n var added = mutations[i].addedNodes || [];\n for (var j = 0; j < added.length; j++) {\n var node = added[j];\n if (node && node.tagName === 'IFRAME') scan(document);\n else scan(node);\n }\n if (mutations[i].type === 'attributes' && mutations[i].attributeName === 'src') scan(document);\n }\n });\n observer.observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['src'] });\n } catch (e) {}\n }\n\n if (typeof document !== 'undefined') {\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, false);\n else start();\n }\n window.addEventListener('message', onMessage, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Cal.com Booking Successful",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "calcom_booking_successful"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Cal.com Booking UID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "booking_uid"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "2",
"name": "DLV - Cal.com Event Type ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "event_type_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "3",
"name": "DLV - Cal.com Booking Status",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "booking_status"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/versions/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Calendly",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Calendly Booking Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n if (window.__ctDetectCalendly) return;\n window.__ctDetectCalendly = true;\n window.dataLayer = window.dataLayer || [];\n\n // The CSS selector matches only Calendly's documented exact embed host.\n // Do not read iframe.src or its `src` attribute: prefill parameters can\n // contain invitee PII. The selector engine performs the prefix match without\n // exposing the URL value to this listener.\n var CALENDLY_FRAME_SELECTOR = 'iframe[src^=\\\"https://calendly.com/\\\"]';\n var CALENDLY_ORIGIN = 'https://calendly.com';\n var API_HOSTS = { 'api.calendly.com': true, 'calendly.com': true };\n var trackedFrames = [];\n var seenPairs = [];\n\n function trackFrame(frame) {\n if (!frame || !frame.contentWindow) return;\n for (var i = 0; i < trackedFrames.length; i++) {\n if (trackedFrames[i].frame === frame) {\n trackedFrames[i].source = frame.contentWindow;\n trackedFrames[i].origin = CALENDLY_ORIGIN;\n return;\n }\n }\n trackedFrames.push({ frame: frame, source: frame.contentWindow, origin: CALENDLY_ORIGIN });\n }\n\n function scan(root) {\n if (!root || typeof root.querySelectorAll !== 'function') return;\n var frames;\n try { frames = root.querySelectorAll(CALENDLY_FRAME_SELECTOR); } catch (e) { return; }\n for (var i = 0; i < frames.length; i++) trackFrame(frames[i]);\n }\n\n function sourceIsTracked(event) {\n for (var i = 0; i < trackedFrames.length; i++) {\n var item = trackedFrames[i];\n try {\n if (item.frame.isConnected === true && item.frame.contentWindow === event.source && item.source === event.source && item.origin === event.origin) return true;\n } catch (e) { /* replaced or inaccessible frames fail closed */ }\n }\n return false;\n }\n\n function resourceIdentity(value, kind) {\n if (typeof value !== 'string' || /[?#]/.test(value)) return null;\n try {\n var url = new URL(value);\n if (url.protocol !== 'https:' || url.port || !API_HOSTS[url.hostname]) return null;\n var eventMatch = /(?:^|\\/)scheduled_events\\/([A-Za-z0-9_-]{1,128})\\/?$/.exec(url.pathname);\n var inviteeMatch = /(?:^|\\/)scheduled_events\\/([A-Za-z0-9_-]{1,128})\\/invitees\\/([A-Za-z0-9_-]{1,128})\\/?$/.exec(url.pathname);\n if (kind === 'event' && eventMatch) return { eventId: eventMatch[1].toLowerCase() };\n if (kind === 'invitee' && inviteeMatch) return { eventId: inviteeMatch[1].toLowerCase(), inviteeId: inviteeMatch[2].toLowerCase() };\n } catch (e) { return null; }\n return null;\n }\n\n function pairSeen(eventId, inviteeId) {\n var key = eventId + ':' + inviteeId;\n for (var i = 0; i < seenPairs.length; i++) if (seenPairs[i] === key) return true;\n seenPairs.push(key);\n return false;\n }\n\n function onMessage(message) {\n if (!message || !message.source || message.source === window || !sourceIsTracked(message)) return;\n var data = message.data;\n if (typeof data === 'string') {\n try { data = JSON.parse(data); } catch (e) { return; }\n }\n if (!data || typeof data !== 'object' || data.event !== 'calendly.event_scheduled') return;\n var payload = data.payload || {};\n var eventUri = payload.event && payload.event.uri;\n var inviteeUri = payload.invitee && payload.invitee.uri;\n var eventIdentity = resourceIdentity(eventUri, 'event');\n var inviteeIdentity = resourceIdentity(inviteeUri, 'invitee');\n if (!eventIdentity || !inviteeIdentity || eventIdentity.eventId !== inviteeIdentity.eventId) return;\n if (pairSeen(eventIdentity.eventId, inviteeIdentity.inviteeId)) return;\n window.dataLayer.push({ event: 'calendly_event_scheduled', event_uri: eventUri, invitee_uri: inviteeUri });\n }\n\n function start() {\n if (typeof document === 'undefined') return;\n scan(document);\n if (typeof MutationObserver === 'undefined' || !document.documentElement) return;\n try {\n var observer = new MutationObserver(function (mutations) {\n for (var i = 0; i < mutations.length; i++) {\n var added = mutations[i].addedNodes || [];\n for (var j = 0; j < added.length; j++) {\n var node = added[j];\n if (node && node.tagName === 'IFRAME') scan(document);\n else scan(node);\n }\n if (mutations[i].type === 'attributes' && mutations[i].attributeName === 'src') scan(document);\n }\n });\n observer.observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['src'] });\n } catch (e) {}\n }\n\n if (typeof document !== 'undefined') {\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, false);\n else start();\n }\n window.addEventListener('message', onMessage, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Calendly Event Scheduled",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "calendly_event_scheduled"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Calendly Event URI",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "event_uri"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "2",
"name": "DLV - Calendly Invitee URI",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "invitee_uri"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Contact Form 7",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Contact Form 7 Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n\n // One shared runtime owns eligibility, accepted event identity, and the ID-only fallback.\n // A legacy recipe guard without this runtime is unknown code, so do not stack a new listener.\n var runtime = window.__ctCf7Runtime;\n if (runtime && runtime.installed) return;\n if (!runtime && window.__ctDetectContactForm7) return;\n runtime = runtime || { installed: false };\n window.__ctCf7Runtime = runtime;\n window.__ctDetectContactForm7 = true;\n window.dataLayer = window.dataLayer || [];\n var seenEvents = typeof WeakSet === 'function' ? new WeakSet() : null;\n var seenEventFallback = [];\n\n function isContactForm7Form(formEl) {\n if (!formEl || (formEl.tagName || '').toLowerCase() !== 'form') return false;\n try {\n if (formEl.classList && formEl.classList.contains('wpcf7-form')) return true;\n return !!(formEl.closest && formEl.closest('.wpcf7'));\n } catch (e) {\n return false;\n }\n }\n\n function validFormId(value) {\n if (typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value && value > 0 && value <= 9007199254740991) return String(value);\n if (typeof value !== 'string' || !/^[1-9]\\d*$/.test(value)) return '';\n var number = Number(value);\n return Number.isFinite(number) && number <= 9007199254740991 && String(number) === value ? value : '';\n }\n\n function readFormId(formEl, event) {\n // CF7 6.1.6's event detail has contactFormId; read no other detail keys.\n var detailId = '';\n try {\n detailId = validFormId(event && event.detail && event.detail.contactFormId);\n } catch (e) {}\n if (detailId) return detailId;\n\n // Compatibility fallback for markup where the event detail omits the ID.\n try {\n var directId = validFormId(formEl.getAttribute && formEl.getAttribute('data-wpcf7-id'));\n if (directId) return directId;\n var wrap = formEl.closest && formEl.closest('.wpcf7');\n return validFormId(wrap && wrap.getAttribute && wrap.getAttribute('data-wpcf7-id'));\n } catch (e) {\n return '';\n }\n }\n\n // CF7 can send both clicks while the first request is still pending.\n // Group those requests without blocking or changing the form submission.\n document.addEventListener('wpcf7beforesubmit', function (event) {\n var formEl = event && event.target;\n if (!isContactForm7Form(formEl)) return;\n if (!formEl.__ctCf7Attempt || formEl.getAttribute('data-status') !== 'submitting') {\n formEl.__ctCf7Attempt = { emitted: false };\n }\n }, false);\n\n document.addEventListener('wpcf7mailsent', function (event) {\n var formEl = event && event.target;\n if (!isContactForm7Form(formEl)) return;\n if (seenEvents) {\n if (seenEvents.has(event)) return;\n seenEvents.add(event);\n } else {\n if (seenEventFallback.indexOf(event) !== -1) return;\n seenEventFallback.push(event);\n if (seenEventFallback.length > 50) seenEventFallback.shift();\n }\n\n var formId = readFormId(formEl, event);\n if (!formId) return;\n var attempt = formEl.__ctCf7Attempt;\n if (attempt && attempt.emitted) return;\n if (attempt) attempt.emitted = true;\n\n // The optional Method 2 adapter may enrich this accepted event. It must\n // return literal true only after pushing; otherwise the shared core emits\n // the same event with IDs only. Neither path inspects event.detail values.\n var enriched = false;\n try {\n if (typeof window.__ctCf7Method2Emit === 'function') {\n enriched = window.__ctCf7Method2Emit(formEl, event, formId) === true;\n }\n } catch (e) {\n enriched = false;\n }\n if (!enriched) {\n window.dataLayer.push({ event: 'contact_form_7_submitted', form_id: formId });\n }\n }, false);\n runtime.installed = true;\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Contact Form 7 Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "contact_form_7_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Contact Form 7 ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Divi Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Divi Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectDiviForms) return;\n window.__ctDetectDiviForms = true;\n window.dataLayer = window.dataLayer || [];\n var reported = typeof WeakSet === 'function' ? new WeakSet() : null;\n function inspect(container) {\n if (!container || !container.querySelector) return;\n var notice;\n try {\n notice = container.querySelector('.et-pb-contact-message.et_pb_success_message');\n if (!notice || container.querySelector('form.et_pb_contact_form') ||\n container.querySelector('.et_pb_contact_error_meesage') ||\n container.querySelector('.et_contact_error')) return;\n } catch (e) { return; }\n if (reported && reported.has(notice)) return;\n if (reported) reported.add(notice);\n var id = container.id || (container.getAttribute && container.getAttribute('data-id')) || '';\n if (!id) return;\n var adapter = window.__ctDiviMethod2Emit;\n if (typeof adapter === 'function' && adapter(container, String(id)) === true) return;\n window.dataLayer.push({ event: 'divi_form_submitted', form_id: String(id) });\n }\n function observe(container) {\n if (!container || container.__ctDiviObserved || typeof MutationObserver === 'undefined') return;\n container.__ctDiviObserved = true;\n new MutationObserver(function () { inspect(container); }).observe(container,\n { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n inspect(container);\n }\n function start() {\n var existing = document.querySelectorAll('.et_pb_contact_form_container');\n for (var i = 0; i < existing.length; i++) observe(existing[i]);\n if (typeof MutationObserver !== 'undefined' && document.documentElement) {\n new MutationObserver(function (records) {\n for (var r = 0; r < records.length; r++) {\n for (var n = 0; n < records[r].addedNodes.length; n++) {\n var node = records[r].addedNodes[n];\n if (node.nodeType !== 1) continue;\n if (node.matches && node.matches('.et_pb_contact_form_container')) observe(node);\n var nested = node.querySelectorAll ? node.querySelectorAll('.et_pb_contact_form_container') : [];\n for (var j = 0; j < nested.length; j++) observe(nested[j]);\n }\n }\n }).observe(document.documentElement, { childList: true, subtree: true });\n }\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });\n else start();\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Divi Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "divi_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Divi Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Elementor Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Elementor Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectElementorForms) return;\n window.__ctDetectElementorForms = true;\n window.dataLayer = window.dataLayer || [];\n var seenEvents = typeof WeakSet === 'function' ? new WeakSet() : null;\n function formFrom(target) {\n try {\n if (!target || target === document || target === window) return null;\n if (target.matches && target.matches('form.elementor-form')) return target;\n return target.closest ? target.closest('form.elementor-form') : null;\n } catch (e) { return null; }\n }\n function formId(form) {\n if (!form) return '';\n if (form.id) return form.id;\n var name = form.getAttribute && form.getAttribute('name');\n if (name && name !== 'New Form') return name;\n var widget = form.closest && form.closest('[data-id]');\n return widget && widget.getAttribute('data-id') || '';\n }\n function onSuccess(event) {\n if (event && seenEvents) {\n if (seenEvents.has(event)) return;\n seenEvents.add(event);\n }\n var form = formFrom(event && event.target);\n var id = formId(form);\n if (!form || !id) return;\n var adapter = window.__ctElementorMethod2Emit;\n if (typeof adapter === 'function') {\n try { if (adapter(form, id) === true) return; }\n catch (e) { return; }\n }\n window.dataLayer.push({ event: 'elementor_form_submitted', form_id: String(id) });\n }\n var handlerBound = false;\n function hook() {\n if (handlerBound) return true;\n var jq = typeof jQuery !== 'undefined' ? jQuery : (typeof $ !== 'undefined' ? $ : null);\n if (!jq) return false;\n jq(document).on('submit_success', onSuccess);\n handlerBound = true;\n return true;\n }\n if (!hook()) {\n document.addEventListener('DOMContentLoaded', hook, { once: true });\n window.addEventListener('load', hook, { once: true });\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Elementor Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "elementor_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Elementor Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"containerVersion": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - File download",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - File download Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectFileDownload) return;\n window.__ctDetectFileDownload = true;\n window.dataLayer = window.dataLayer || [];\n\n /* For gated content that is NOT gated: price lists, brochures, spec\n sheets, lead magnets served as a direct link. If the download sits\n behind a form, track the form instead — that is where the lead is.\n\n GA4 already collects file_download as an enhanced measurement event.\n Use this when you need the same signal in Google Ads or Meta, which\n do not. */\n\n // EDIT if you serve other formats.\n var EXTENSIONS = [\n 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',\n 'csv', 'zip', 'rar', '7z', 'dmg', 'exe', 'pkg',\n 'mp3', 'mp4', 'mov', 'wav', 'txt', 'rtf'\n ];\n\n var DEDUPE_MS = 2000;\n var lastUrl = null;\n var lastAt = 0;\n\n function extensionOf(url) {\n try {\n // Strip query and hash before reading the extension, so\n // /brochure.pdf?utm_source=x still resolves to \"pdf\".\n var path = String(url || '').split('#')[0].split('?')[0];\n var name = path.substring(path.lastIndexOf('/') + 1);\n var dot = name.lastIndexOf('.');\n if (dot < 0) return null;\n var ext = name.substring(dot + 1).toLowerCase();\n for (var i = 0; i < EXTENSIONS.length; i++) {\n if (EXTENSIONS[i] === ext) return ext;\n }\n } catch (e) { /* fall through */ }\n return null;\n }\n\n function fileNameOf(url) {\n try {\n var path = String(url || '').split('#')[0].split('?')[0];\n return decodeURIComponent(path.substring(path.lastIndexOf('/') + 1));\n } catch (e) {\n return '';\n }\n }\n\n function handleClick(event) {\n try {\n if (event.button !== undefined && event.button !== 0) return;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n var target = event.target;\n if (!target || !target.closest) return;\n\n var link = target.closest('a[href]');\n if (!link) return;\n\n // Resolve relative hrefs against the current page. .href does this for\n // us where available; getAttribute would leave \"/files/x.pdf\" relative.\n var url = link.href || link.getAttribute('href');\n if (!url) return;\n\n // An anchor carrying the download attribute is a download regardless\n // of extension, so honour that too.\n var ext = extensionOf(url);\n var forced = link.hasAttribute && link.hasAttribute('download');\n if (!ext && !forced) return;\n\n var now = new Date().getTime();\n if (url === lastUrl && (now - lastAt) < DEDUPE_MS) return;\n lastUrl = url;\n lastAt = now;\n\n window.dataLayer.push({\n event: 'file_download',\n file_name: fileNameOf(url),\n file_extension: ext || '',\n file_url: url,\n link_text: (link.textContent || '').trim().slice(0, 100),\n page_path: window.location.pathname\n });\n } catch (e) {\n // Never throw back into the page's own click handling.\n }\n }\n\n document.addEventListener('click', handleClick, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - File download",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "file_download"
}
]
}
],
"filter": []
}
],
"variable": [],
"fingerprint": "0"
}
}
{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Fluent Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Fluent Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctFluentForms) return;\n window.__ctFluentForms = true;\n window.dataLayer = window.dataLayer || [];\n var listeners = [], lastEvent = null;\n // Fluent Forms 6.2.5 reports one success response through three different\n // event objects. Deduplicate by response-object identity and original form\n // node; never inspect or retain a response's fields.\n var seenResponses = typeof WeakMap === 'function' ? new WeakMap() : null;\n window.__ctFluentSubscribe = function (listener) {\n if (listener && typeof listener === 'object') listeners.push(listener);\n };\n function isForm(form) {\n try {\n if (!form || String(form.tagName || '').toLowerCase() !== 'form') return false;\n if (String(form.className || '').indexOf('frm-fluent-form') !== -1) return true;\n if (form.closest && form.closest('.fluentform')) return true;\n return /^fluentform_\\d+$/.test(form.id || '');\n } catch (e) { return false; }\n }\n function asForm(candidate) {\n try {\n var el = candidate;\n if (el && el.jquery && el.length) el = el[0];\n return isForm(el) ? el : null;\n } catch (e) { return null; }\n }\n function notify(phase, form, candidate, event, arg2, arg3) {\n var handled = false;\n for (var i=0;i<listeners.length;i++) {\n try { var fn=listeners[i] && listeners[i][phase]; if(typeof fn==='function' && fn(form,candidate,event,arg2,arg3)===true)handled=true; } catch(e) {}\n }\n return handled;\n }\n function submit(event) {\n try { var form=event.target; if(isForm(form)) notify('beforeAttempt',form,false,event); } catch(e) {}\n }\n function resolve(event,arg2,arg3) {\n try {\n var form=asForm(arg2 && arg2.form) || asForm(arg3) || asForm(arg2);\n if(form)return form;\n var oe=event && event.originalEvent;\n if(oe && oe.detail) return asForm(oe.detail.form);\n return asForm(event && event.target);\n } catch(e) { return null; }\n }\n function responseFor(event, arg2) {\n try {\n var descriptor = arg2 && Object.getOwnPropertyDescriptor(arg2, 'response');\n var response = descriptor && Object.prototype.hasOwnProperty.call(descriptor, 'value') ? descriptor.value : null;\n if (response && typeof response === 'object') return response;\n var originalEvent = event && event.originalEvent;\n var detail = originalEvent && originalEvent.detail;\n descriptor = detail && Object.getOwnPropertyDescriptor(detail, 'response');\n response = descriptor && Object.prototype.hasOwnProperty.call(descriptor, 'value') ? descriptor.value : null;\n return response && typeof response === 'object' ? response : null;\n } catch(e) { return null; }\n }\n function alreadySeen(response, form) {\n try {\n if (!seenResponses || !response || !form || typeof response !== 'object' || typeof form !== 'object') return true;\n var forms = seenResponses.get(response);\n if (!forms) {\n forms = typeof WeakSet === 'function' ? new WeakSet() : null;\n if (!forms) return true;\n seenResponses.set(response, forms);\n }\n if (forms.has(form)) return true;\n forms.add(form);\n return false;\n } catch(e) { return true; }\n }\n function success(event,arg2,arg3) {\n try {\n if (event && typeof event === 'object' && event === lastEvent) return;\n lastEvent=event;\n if (event && typeof event === 'object') setTimeout(function(){if(lastEvent===event)lastEvent=null;},0);\n var form=resolve(event,arg2,arg3);\n if(!form)return;\n var response=responseFor(event,arg2);\n if(!response || alreadySeen(response,form))return;\n if(!notify('onCandidate',form,true,event,arg2,arg3)) window.dataLayer.push({event:'fluent_forms_submitted',form_id:form.id || ''});\n } catch(e) {}\n }\n document.addEventListener('submit',submit,true);\n function hook() {\n try {\n if (window.__ctFluentSuccessHooked || !window.jQuery) return false;\n window.__ctFluentSuccessHooked=true;\n window.jQuery(document).on('fluentform_submission_success',success);\n return true;\n } catch(e) { return false; }\n }\n if(!hook()) {\n document.addEventListener('DOMContentLoaded',hook);\n window.addEventListener('load',hook);\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Fluent Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "fluent_forms_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Fluent Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0",
"exportTime": "2026-07-05 00:00:00"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Formidable Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Formidable Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n\n // Shared with the recipe snippet so template + recipe installation is one listener.\n if (window.__ctDetectFormidableForms) return;\n window.__ctDetectFormidableForms = true;\n if (!/^https?:$/.test(window.location.protocol)) return;\n window.dataLayer = window.dataLayer || [];\n\n var MARKER_KEY = '__ctDetectFormidableNativePendingV2';\n var MARKER_TTL_MS = 60000;\n var handledResponses = typeof WeakSet === 'function' ? new WeakSet() : [];\n var activeAttempts = [];\n var jqueryHooked = false;\n\n function safeId(value) {\n var id = String(value || '');\n return /^[1-9][0-9]*$/.test(id) ? id : '';\n }\n\n // Formidable's hidden form_id is non-sensitive structural metadata. No other\n // field value, response property, label, HTML, or rendered text is inspected.\n function formId(form) {\n if (!form || typeof form.querySelector !== 'function') return '';\n try {\n var input = form.querySelector('input[name=\"form_id\"]');\n return input && input.getAttribute ? safeId(input.getAttribute('value')) : '';\n } catch (e) {\n return '';\n }\n }\n\n function wrapperFor(id) {\n if (!id) return null;\n try { return document.getElementById('frm_form_' + id + '_container'); } catch (e) { return null; }\n }\n\n function hasNode(scope, selector) {\n if (!scope || typeof scope.querySelector !== 'function') return false;\n try { return !!scope.querySelector(selector); } catch (e) { return false; }\n }\n\n function hasRejectionMarker(id) {\n return hasNode(wrapperFor(id), '.frm_error, .frm_error_style, .frm_blank_field, [aria-invalid=\"true\"]');\n }\n\n function hasSuccessMarker(id) {\n return hasNode(wrapperFor(id), '.frm_message');\n }\n\n function responseWasHandled(response) {\n if (!response || (typeof response !== 'object' && typeof response !== 'function')) return true;\n if (typeof WeakSet === 'function' && handledResponses instanceof WeakSet) {\n if (handledResponses.has(response)) return true;\n handledResponses.add(response);\n return false;\n }\n for (var i = 0; i < handledResponses.length; i++) {\n if (handledResponses[i] === response) return true;\n }\n handledResponses.push(response);\n if (handledResponses.length > 100) handledResponses.shift();\n return false;\n }\n\n function push(id) {\n if (!id) return;\n window.dataLayer.push({ event: 'formidable_forms_submitted', form_id: id });\n }\n\n // Optional Method 2 adapter owns any enriched push. The detector passes only\n // structural metadata and accepts only a literal true handled verdict; it\n // never receives or inspects an adapter payload.\n function emitAccepted(id, form, source) {\n var handled = false;\n try {\n if (typeof window.__ctFormidableMethod2Emit === 'function') {\n handled = window.__ctFormidableMethod2Emit(id, form, source) === true;\n }\n } catch (e) {}\n if (!handled) push(id);\n }\n\n // In 6.32.1 these are jQuery events: formidable.js calls\n // jQuery(document).trigger(name, [form, response]). addEventListener does not\n // receive these success events. The response is used only by object identity\n // so the redirect and completion callbacks for one response count once.\n function onAjaxSuccess(event, form, response) {\n var id = formId(form);\n if (!id || !response || responseWasHandled(response)) return;\n emitAccepted(id, form, 'ajax');\n disarmAttempt(form);\n }\n\n function hookJquery() {\n if (jqueryHooked) return true;\n var jq = window.jQuery || window.$;\n if (typeof jq !== 'function') return false;\n jq(document).on(\n 'frmFormComplete.ctRecipe frmBeforeFormRedirect.ctRecipe',\n onAjaxSuccess\n );\n jqueryHooked = true;\n return true;\n }\n\n function readMarker() {\n try {\n var raw = window.sessionStorage.getItem(MARKER_KEY);\n if (!raw) return null;\n window.sessionStorage.removeItem(MARKER_KEY);\n var marker = JSON.parse(raw);\n if (!marker || typeof marker !== 'object') return null;\n if (typeof marker.t !== 'number' || Date.now() < marker.t || Date.now() - marker.t > MARKER_TTL_MS) return null;\n if (marker.hadSuccessAtSubmit === true) return null;\n return { id: safeId(marker.id), origin: marker.origin, path: marker.path };\n } catch (e) {\n try { window.sessionStorage.removeItem(MARKER_KEY); } catch (e2) {}\n return null;\n }\n }\n\n // Native success either renders a form-specific message or redirects away\n // from the submitted form. Rejection stays on the form page with errors.\n // Only origin and pathname are retained, never query strings or form answers.\n function processNativeMessage() {\n var marker = readMarker();\n if (!marker || !marker.id || hasRejectionMarker(marker.id)) return;\n var redirected = marker.origin === window.location.origin &&\n typeof marker.path === 'string' && marker.path !== window.location.pathname &&\n !wrapperFor(marker.id) && !hasNode(document, '.frm_error, .frm_error_style');\n if (hasSuccessMarker(marker.id) || redirected) {\n var wrapper = wrapperFor(marker.id);\n var form = null;\n try { form = wrapper && wrapper.querySelector ? wrapper.querySelector('form') : null; } catch (e) {}\n emitAccepted(marker.id, form, 'native');\n }\n }\n\n function getAttempt(form) {\n for (var i = 0; i < activeAttempts.length; i++) {\n if (activeAttempts[i].form === form) return activeAttempts[i];\n }\n return null;\n }\n\n function disarmAttempt(form) {\n var attempt = getAttempt(form);\n if (!attempt) return;\n try { window.removeEventListener('pagehide', attempt.onPageHide, true); } catch (e) {}\n var index = activeAttempts.indexOf(attempt);\n if (index !== -1) activeAttempts.splice(index, 1);\n }\n\n function armNativeMessageAttempt(event) {\n var form = event && event.target;\n if (!form || String(form.tagName || '').toLowerCase() !== 'form') return;\n var isFormidable = false;\n try { isFormidable = !!(form.closest && form.closest('.frm_forms')); } catch (e) {}\n if (!isFormidable) return;\n var id = formId(form);\n if (!id) return;\n var wrapper = wrapperFor(id);\n var hadSuccessAtSubmit = hasNode(wrapper, '.frm_message');\n var prior = getAttempt(form);\n if (prior) disarmAttempt(form);\n var attempt = { form: form, id: id, hadSuccessAtSubmit: hadSuccessAtSubmit, onPageHide: null };\n attempt.onPageHide = function () {\n disarmAttempt(form);\n // Old server errors remain visible while a corrected native POST leaves.\n // Decide acceptance from the response page, not the departing page.\n if (attempt.hadSuccessAtSubmit) return;\n try {\n window.sessionStorage.setItem(MARKER_KEY, JSON.stringify({\n t: Date.now(),\n id: attempt.id,\n hadSuccessAtSubmit: false,\n origin: window.location.origin,\n path: window.location.pathname\n }));\n } catch (e) {}\n };\n activeAttempts.push(attempt);\n try { window.addEventListener('pagehide', attempt.onPageHide, true); } catch (e) {}\n }\n\n hookJquery();\n if (!jqueryHooked) {\n document.addEventListener('DOMContentLoaded', hookJquery, { once: true });\n window.addEventListener('load', hookJquery, { once: true });\n }\n document.addEventListener('submit', armNativeMessageAttempt, true);\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', processNativeMessage, { once: true });\n } else {\n processNativeMessage();\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Formidable Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "formidable_forms_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Formidable Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Forminator",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Forminator Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctForminatorForms) return;\n window.__ctForminatorForms = true;\n window.dataLayer = window.dataLayer || [];\n var listeners=[],lastEvent=null;\n window.__ctForminatorSubscribe=function(listener){if(listener&&typeof listener==='object')listeners.push(listener);};\n function isForm(form){\n try{return !!(form&&String(form.tagName||'').toLowerCase()==='form'&&form.classList&&form.classList.contains('forminator-custom-form'));}\n catch(e){return false;}\n }\n function notify(phase,form,candidate,event){\n var handled=false;\n for(var i=0;i<listeners.length;i++)try{var fn=listeners[i]&&listeners[i][phase];if(typeof fn==='function'&&fn(form,candidate,event)===true)handled=true;}catch(e){}\n return handled;\n }\n function submit(event){try{var form=event.target;if(isForm(form))notify('beforeAttempt',form,false,event);}catch(e){}}\n function success(event){\n try{\n if(event&&typeof event==='object'&&event===lastEvent)return;\n lastEvent=event;\n if(event&&typeof event==='object')setTimeout(function(){if(lastEvent===event)lastEvent=null;},0);\n var form=event&&event.target;if(!isForm(form))return;\n if(!notify('onCandidate',form,true,event))window.dataLayer.push({event:'forminator_form_submitted',form_id:form.getAttribute('data-form-id')||''});\n }catch(e){}\n }\n document.addEventListener('submit',submit,true);\n // Page-reload forms render their verdict in the returned page instead of\n // emitting the AJAX event. Read only the confirmation class and form ID.\n var confirmedForms=[];\n function nativeConfirmations(){\n try{\n var forms=document.querySelectorAll('form.forminator-custom-form:not(.forminator_ajax)');\n for(var i=0;i<forms.length;i++){\n var form=forms[i],message=form.querySelector('.forminator-response-message.forminator-success');\n if(!message||!message.getClientRects().length||confirmedForms.indexOf(form)!==-1)continue;\n confirmedForms.push(form);\n success({target:form});\n }\n }catch(e){}\n }\n function watchNative(){\n nativeConfirmations();\n if(window.MutationObserver&&document.documentElement){\n new MutationObserver(nativeConfirmations).observe(document.documentElement,{childList:true,subtree:true,attributes:true,attributeFilter:['class','style']});\n }\n }\n if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',watchNative);\n else watchNative();\n window.addEventListener('load',nativeConfirmations);\n function hook(){\n try{\n if(window.__ctForminatorSuccessHooked)return true;\n var jq=window.jQuery||(typeof jQuery!=='undefined'?jQuery:(typeof $!=='undefined'?$:null));\n if(!jq)return false;\n window.__ctForminatorSuccessHooked=true;\n jq(document).on('forminator:form:submit:success',success);return true;\n }catch(e){return false;}\n }\n if(!hook()){document.addEventListener('DOMContentLoaded',hook);window.addEventListener('load',hook);}\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Forminator Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "forminator_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Forminator Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Framer Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Framer Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctFramerForms) return;\n window.__ctFramerForms = true;\n window.dataLayer = window.dataLayer || [];\n var listeners = [];\n var pending = [];\n window.__ctFramerSubscribe = function (listener) {\n if (listener && typeof listener === 'object') listeners.push(listener);\n };\n function isFramerForm(form) {\n try {\n if (!form || String(form.tagName || '').toLowerCase() !== 'form') return false;\n if (form.hasAttribute && form.hasAttribute('data-framer-name')) return true;\n if (typeof form.className === 'string' && /(^|\\s)framer-[A-Za-z0-9_-]+/.test(form.className)) return true;\n return !!(form.closest && (form.closest('[data-framer-component-type]') || form.closest('[data-framer-name]')));\n } catch (e) { return false; }\n }\n function notify(phase, form, candidate) {\n var handled = false;\n for (var i = 0; i < listeners.length; i++) {\n try {\n var fn = listeners[i] && listeners[i][phase];\n if (typeof fn === 'function' && fn(form, candidate) === true) handled = true;\n } catch (e) {}\n }\n return handled;\n }\n function remember(form) {\n try {\n if (!isFramerForm(form)) return;\n for (var i = 0; i < pending.length; i++) {\n if (pending[i].form === form) return;\n }\n pending.push({ form: form, time: Date.now(), claimed: false });\n notify('beforeAttempt', form, false);\n } catch (e) {}\n }\n function finish(attempts, accepted) {\n for (var i = 0; i < attempts.length; i++) {\n var index = pending.indexOf(attempts[i]);\n if (index !== -1) pending.splice(index, 1);\n }\n if (!accepted) return;\n // Concurrent forms cannot be attributed without inspecting answers.\n // Keep those submissions event-only, with no guessed form name.\n var form = attempts.length === 1 ? attempts[0].form : null;\n var name = form ? form.getAttribute('data-framer-name') || form.id || '' : '';\n if (!form || !notify('onCandidate', form, true)) {\n window.dataLayer.push({ event: 'framer_form_submitted', form_name: name });\n }\n }\n if (typeof window.fetch === 'function') {\n var originalFetch = window.fetch;\n window.fetch = function (input, options) {\n var attempts = null;\n try {\n var url = typeof input === 'string' ? input : input && input.url;\n var method = options && options.method || input && input.method || 'GET';\n if (String(method).toUpperCase() === 'POST' && /^https:\\/\\/api\\.framer\\.com\\/forms\\/v1\\/forms\\/[a-f0-9-]+\\/submit(?:\\?.*)?$/.test(url || '')) {\n attempts = [];\n var now = Date.now();\n pending = pending.filter(function (attempt) { return now - attempt.time < 60000; });\n for (var i = 0; i < pending.length; i++) {\n if (!pending[i].claimed) {\n pending[i].claimed = true;\n attempts.push(pending[i]);\n }\n }\n }\n } catch (e) {}\n var result = originalFetch.apply(this, arguments);\n if (attempts) result.then(function (response) {\n try { finish(attempts, response.ok === true); } catch (e) {}\n }, function () {\n try { finish(attempts, false); } catch (e) {}\n });\n return result;\n };\n }\n if (typeof document !== 'undefined' && document.addEventListener) {\n document.addEventListener('submit', function (event) { remember(event.target); }, true);\n // Framer handles Enter directly instead of dispatching native submit.\n document.addEventListener('keydown', function (event) {\n var target = event.target;\n if (event.key === 'Enter' && target && String(target.tagName).toLowerCase() !== 'textarea') {\n var form = target.form;\n if (isFramerForm(form) && form.matches(':valid')) remember(form);\n }\n }, true);\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Framer Form Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "framer_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Framer Form Name",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_name"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"containerVersion": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Generic AJAX form",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Generic AJAX form Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectGenericAjaxForm) return;\n window.__ctDetectGenericAjaxForm = true;\n window.dataLayer = window.dataLayer || [];\n\n /* Last-resort fallback for form tools this repo has no specific snippet\n for. It infers success from the page changing after a submit, which is\n weaker than a tool's own success event. Always prefer a named snippet\n from snippets/ when one exists for the tool.\n\n The design deliberately refuses to fire on submit alone. A submit is an\n attempt; only a success signal appearing afterwards, with no visible\n validation error, is treated as a conversion. */\n\n var SUCCESS_WINDOW_MS = 7000; // how long to wait for a success signal\n var watchers = [];\n\n function fire(formEl) {\n window.dataLayer.push({\n event: 'form_submitted',\n form_id: (formEl && formEl.id) || '',\n form_name: (formEl && formEl.getAttribute && formEl.getAttribute('name')) || '',\n page_path: window.location.pathname,\n detection: 'generic-ajax'\n });\n }\n\n function isHidden(el) {\n try {\n if (el.hidden) return true;\n if (el.getAttribute && el.getAttribute('aria-hidden') === 'true') return true;\n var view = el.ownerDocument && el.ownerDocument.defaultView;\n if (view && view.getComputedStyle) {\n var cs = view.getComputedStyle(el);\n if (cs && (cs.display === 'none' || cs.visibility === 'hidden')) return true;\n }\n } catch (e) { /* fall through */ }\n return false;\n }\n\n // A visible validation error means the submit was rejected. This is the\n // guard that stops a failed submission being counted.\n function hasVisibleError(root) {\n try {\n var nodes = root.querySelectorAll(\n '[aria-invalid=\"true\"], .error, .is-invalid, [class*=\"error\"], [role=\"alert\"]'\n );\n for (var i = 0; i < nodes.length; i++) {\n if (isHidden(nodes[i])) continue;\n if (nodes[i].getAttribute &&\n nodes[i].getAttribute('aria-invalid') === 'true') return true;\n if ((nodes[i].textContent || '').trim()) return true;\n }\n } catch (e) { /* fall through */ }\n return false;\n }\n\n function looksLikeSuccess(node) {\n if (!node || node.nodeType !== 1) return false;\n try {\n var cls = (typeof node.className === 'string' ? node.className : '') || '';\n var hook = (node.getAttribute && node.getAttribute('data-hook')) || '';\n if (/error|invalid/i.test(cls + ' ' + hook)) return false;\n\n // Structural marker the tool itself stamped. Strongest signal here.\n if (/success|confirmation|thank/i.test(cls + ' ' + hook)) return true;\n\n var text = (node.textContent || '').trim();\n if (!text || text.length > 300) return false;\n if (/error|required|invalid|try again|please enter|please fill/i.test(text)) return false;\n // Still in flight, not done.\n if (/^(submitting|sending|loading|processing|please wait|one moment)\\b/i.test(text)) return false;\n return /thank you|thanks|success|received|we'?ll be in touch|message sent|submitted/i.test(text);\n } catch (e) {\n return false;\n }\n }\n\n function watch(formEl) {\n for (var i = 0; i < watchers.length; i++) {\n if (watchers[i].form === formEl) return; // already watching this form\n }\n\n var entry = { form: formEl };\n watchers.push(entry);\n\n var done = false;\n var observer = null;\n var timer = null;\n\n function stop() {\n done = true;\n if (observer) { try { observer.disconnect(); } catch (e) {} }\n if (timer) { clearTimeout(timer); }\n for (var j = 0; j < watchers.length; j++) {\n if (watchers[j] === entry) { watchers.splice(j, 1); break; }\n }\n }\n\n function evaluate(nodes) {\n if (done) return;\n // A visible error anywhere in the form means rejection. Give up.\n if (hasVisibleError(formEl)) { stop(); return; }\n for (var k = 0; k < nodes.length; k++) {\n if (looksLikeSuccess(nodes[k])) {\n fire(formEl);\n stop();\n return;\n }\n }\n }\n\n try {\n observer = new MutationObserver(function (mutations) {\n var added = [];\n for (var a = 0; a < mutations.length; a++) {\n var m = mutations[a];\n for (var b = 0; b < m.addedNodes.length; b++) added.push(m.addedNodes[b]);\n if (m.type === 'attributes' && m.target) added.push(m.target);\n }\n if (added.length) evaluate(added);\n });\n // Watch the form's container, so a success panel that REPLACES the form\n // is still seen. Falls back to the form itself.\n var scope = formEl.parentNode || formEl;\n observer.observe(scope, {\n childList: true, subtree: true,\n attributes: true, attributeFilter: ['class', 'style', 'hidden', 'aria-hidden']\n });\n } catch (e) {\n stop();\n return;\n }\n\n timer = setTimeout(stop, SUCCESS_WINDOW_MS);\n }\n\n function handleSubmit(event) {\n try {\n var formEl = event.target;\n if (!formEl || (formEl.tagName || '').toLowerCase() !== 'form') return;\n\n // Another handler already cancelled this submission.\n if (event.defaultPrevented) return;\n\n // Constraint validation gate: an invalid form cannot have submitted.\n try {\n if (typeof formEl.checkValidity === 'function' &&\n formEl.checkValidity() === false) return;\n } catch (e) { /* validation unavailable — fall through */ }\n\n watch(formEl);\n } catch (e) {\n // Never throw back into the page's own form handling.\n }\n }\n\n // Bubble phase so the tool's own handlers run first.\n document.addEventListener('submit', handleSubmit, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Generic AJAX form",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [],
"fingerprint": "0"
}
}
{
"exportFormatVersion": 2,
"exportTime": "2026-07-05 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Gravity Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Gravity Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n/* Gravity Forms Submission Listener.\n * Event-only adaptation of verified production detection helpers.\n * Source SHA256 3ed591d48dc449e94fd48f634bb07ae8285f5d661a4b48fc5db867ca3e659b69.\n * Reads no form field values. Sends only event and form_id to dataLayer.\n * Native handoff stores only form ID, source path and time in sessionStorage.\n */\n(function(){\n\"use strict\";\nif(window.__ctGalleryGravityForms)return;\nwindow.__ctGalleryGravityForms=true;\n// Preserve the original recipe guard for an old recipe loaded after this code.\n// Do not return on the legacy guard: an old-first listener is independently\n// active and remains an unsupported migration state, but must not suppress us.\nwindow.__ctDetectGravityForms=true;\nfunction isGravityForm(formEl) {\n if (!formEl) return false;\n // Check for gform_wrapper parent or gform_ ID prefix\n try {\n if (formEl.closest && formEl.closest('.gform_wrapper')) return true;\n } catch (e) {\n // .closest not available — fall back to ID check\n }\n // Fallback: GF forms have IDs like \"gform_1\", \"gform_5\"\n var id = formEl.id || '';\n return /^gform_\\d+$/.test(id);\n }\n\nfunction getFormId(formEl) {\n if (!formEl) return null;\n var fid = (formEl.getAttribute && formEl.getAttribute('data-formid')) || '';\n if (fid) return String(fid);\n var id = formEl.id || '';\n var m = /gform_(\\d+)/.exec(id);\n return m ? m[1] : null;\n }\n\nfunction isAjaxForm(formEl) {\n if (!formEl) return false;\n try {\n var target = (formEl.getAttribute && formEl.getAttribute('target')) || '';\n if (target.indexOf('gform_ajax_frame_') === 0) return true;\n if (formEl.querySelector && formEl.querySelector('input[name=\"gform_ajax\"]')) {\n return true;\n }\n } catch (e) {\n // DOM access failed — treat as non-AJAX; the reload path is the\n // safer default (it still only fires on confirmed success).\n }\n return false;\n }\n\nfunction isNodeHidden(el) {\n try {\n if (el.hidden) return true;\n if (el.getAttribute && el.getAttribute('aria-hidden') === 'true') return true;\n var view = el.ownerDocument && el.ownerDocument.defaultView;\n if (view && view.getComputedStyle) {\n var cs = view.getComputedStyle(el);\n if (cs && (cs.display === 'none' || cs.visibility === 'hidden')) return true;\n }\n } catch (e) {\n // fall through\n }\n return false;\n }\n\nfunction hasVisibleValidationErrors(rootEl) {\n if (!rootEl || !rootEl.querySelectorAll) return false;\n try {\n if (rootEl.className &&\n (' ' + rootEl.className + ' ').indexOf(' gform_validation_error ') !== -1) {\n return true;\n }\n var nodes = rootEl.querySelectorAll(\n '.gform_validation_errors, .validation_error, .gfield_error, .validation_message, [aria-invalid=\"true\"]'\n );\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (isNodeHidden(node)) continue;\n if (node.getAttribute && node.getAttribute('aria-invalid') === 'true') return true;\n // Error classes and ARIA state are structural signals. Never read\n // rendered validation text: themes may include resolved field values.\n var classes = typeof node.className === 'string' ? node.className : '';\n if (/^(?:.*\\s)?(?:gform_validation_errors|validation_error|gfield_error)(?:\\s.*)?$/.test(classes)) return true;\n }\n } catch (e) {\n // fall through\n }\n return false;\n }\n\nfunction safeFormId(formId) {\n if (formId == null) return null;\n var s = String(formId);\n return /^\\d+$/.test(s) ? s : null;\n }\n\nfunction hasServerRejectionMarkers(formId) {\n var fid = safeFormId(formId);\n try {\n if (fid) {\n var scope = document.querySelector('#gform_wrapper_' + fid) ||\n document.querySelector('#gform_' + fid + ', form[data-formid=\"' + fid + '\"]');\n if (scope && scope.closest) {\n scope = scope.closest('.gform_wrapper') || scope;\n }\n // The submitted form isn't on this page at all → no rejection\n // evidence FOR THIS FORM, whatever other forms are showing.\n return scope ? hasVisibleValidationErrors(scope) : false;\n }\n var wrappers = document.querySelectorAll('.gform_wrapper');\n for (var i = 0; i < wrappers.length; i++) {\n if (hasVisibleValidationErrors(wrappers[i])) return true;\n }\n } catch (e) {\n // fall through\n }\n return false;\n }\n\nfunction hasConfirmationMessage(formId) {\n var fid = safeFormId(formId);\n try {\n var nodes = document.querySelectorAll(\n '.gform_confirmation_message, [id^=\"gform_confirmation_message_\"], [id^=\"gform_confirmation_wrapper_\"]'\n );\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (isNodeHidden(node)) continue;\n // Presence of a visible, form-attributed confirmation element is a\n // structural legacy signal; its rendered contents are never inspected.\n if (!fid) continue;\n // Attribute the node to a form id if it carries one (own id or an\n // ancestor confirmation-wrapper id).\n var taggedId = null;\n var m = /gform_confirmation_(?:message|wrapper)_(\\d+)/.exec(node.id || '');\n if (m) {\n taggedId = m[1];\n } else if (node.closest) {\n try {\n var anc = node.closest('[id^=\"gform_confirmation_wrapper_\"], [id^=\"gform_confirmation_message_\"]');\n var am = anc && /_(\\d+)$/.exec(anc.id || '');\n if (am) taggedId = am[1];\n } catch (e2) {\n // .closest unavailable — treat as untagged\n }\n }\n if (taggedId === fid) return true;\n }\n } catch (e) {\n // fall through\n }\n return false;\n }\nvar pending={},complete={},TTL=120000,markerKey='__ct_gallery_gf_pending_v3';\nvar modernHookInstalled=false,seenEntries={};\nwindow.dataLayer=window.dataLayer||[];\nfunction forget(id){var entry=pending[id];if(entry&&entry.timer)clearTimeout(entry.timer);delete pending[id];}\nfunction discardNotice(id,reason,form){try{document.dispatchEvent(new CustomEvent('ct:gform-attempt-discarded',{detail:{formId:String(id||''),reason:reason||'discarded',form:form||null}}));}catch(e){}}\nfunction emitConfirmed(id,form,uniqueAccepted){id=safeFormId(id);if(!id||(!uniqueAccepted&&complete[id]))return;complete[id]=true;var handled=false;try{if(typeof window.__ctGravityMethod2Emit==='function')handled=window.__ctGravityMethod2Emit(id,form)===true;}catch(e){}if(!handled)window.dataLayer.push({event:'gravity_form_submitted',form_id:id});}\nfunction fireLegacy(id){id=safeFormId(id);if(modernHookInstalled||!id||!pending[id]||complete[id])return;var form=pending[id].form;forget(id);emitConfirmed(id,form);}\nfunction attempt(form,method,type){\n if(!isGravityForm(form))return;var id=safeFormId(getFormId(form));if(!id)return;\n if(modernHookInstalled){return;}\n if(type&&type!=='submit'){forget(id);discardNotice(id,'nonfinal');return;}\n forget(id);complete[id]=false;\n var entry={form:form,method:method||(isAjaxForm(form)?'iframe':'postback'),trusted:method==='postback',time:Date.now(),path:location.pathname,timer:null};\n entry.timer=setTimeout(function(){if(pending[id]===entry){forget(id);discardNotice(id,'timeout');}},TTL);pending[id]=entry;\n}\nfunction acceptedIframe(frame){\n if(modernHookInstalled||!frame||frame.tagName!=='IFRAME'||!/^gform_ajax_frame_\\d+$/.test(frame.id||''))return;\n var id=frame.id.replace('gform_ajax_frame_','');if(!pending[id])return;\n try{var doc=frame.contentDocument;if(!doc||!doc.querySelector('.GF_AJAX_POSTBACK'))return;if(doc.querySelector('.gform_validation_error, .gform_validation_errors, .gfield_error, [aria-invalid=\\\"true\\\"]')){forget(id);discardNotice(id,'rejected');return;}var confirmation=doc.querySelector('#gform_confirmation_wrapper_'+id+', #gform_confirmation_message_'+id);if(confirmation&&!isNodeHidden(confirmation))fireLegacy(id);}catch(e){}\n}\ndocument.addEventListener('load',function(event){acceptedIframe(event.target);},true);\nvar jqueryHooked=false;\nfunction hook(){\n if(!jqueryHooked&&typeof window.jQuery==='function'){jqueryHooked=true;window.jQuery(document).on('gform_confirmation_loaded.ctGallery',function(event,id){fireLegacy(id);});}\n if(modernHookInstalled||!window.gform||!gform.utils||!gform.utils.addAsyncFilter)return;\n modernHookInstalled=true;\n gform.utils.addAsyncFilter('gform/submission/pre_submission',function(data){\n var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));\n if(!id)return data;\n if(data.submissionType!=='submit'){\n discardNotice(id,'nonfinal',form);\n return data;\n }\n if(data.abort===true)return data;\n if(data.submissionMethod==='postback'||data.submissionMethod==='iframe')data.submissionMethod='ajax';\n return data;\n });\n gform.utils.addAsyncFilter('gform/submission/submission_started',function(data){\n var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));\n if(id&&data.submissionType==='submit')complete[id]=false;\n return data;\n });\n gform.utils.addAsyncFilter('gform/ajax/post_ajax_submission',function(data){\n var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));if(!id)return data;\n var result=data&&data.submissionResult,verdict=result&&result.data;\n var rawEntryId=verdict&&verdict.entry_id,entryId=typeof rawEntryId==='number'?rawEntryId:(typeof rawEntryId==='string'&&/^\\d+$/.test(rawEntryId)?Number(rawEntryId):NaN);\n var key=id+':'+entryId;\n if(result&&result.success===true&&verdict&&verdict.is_valid===true&&verdict.submission_type==='submit'&&isFinite(entryId)&&Math.floor(entryId)===entryId&&entryId>0&&entryId<=9007199254740991&&verdict.is_spam===false){\n if(seenEntries[key]){discardNotice(id,'duplicate-entry',form);return data;}\n seenEntries[key]=true;emitConfirmed(id,form,true);\n }else if(result&&result.success===true)discardNotice(id,'rejected',form);\n return data;\n });\n gform.utils.addAsyncFilter('gform/ajax/pre_display_error',function(data){\n if(data&&data.formId){var errorForm=null;try{errorForm=document.querySelector('#gform_'+safeFormId(data.formId));}catch(e){}discardNotice(data.formId,'ajax-error',errorForm);}\n return data;\n });\n document.addEventListener('gform/submission/submission_aborted',function(event){\n var form=event&&event.detail&&event.detail.form,id=safeFormId(getFormId(form));\n if(id)discardNotice(id,'abort',form);\n });\n}\nhook();document.addEventListener('gform/theme/scripts_loaded',hook);document.addEventListener('DOMContentLoaded',hook);window.addEventListener('load',hook);\ndocument.addEventListener('submit',function(event){attempt(event.target,null,'submit');},true);\ndocument.addEventListener('click',function(event){var el=event.target;if(!el||!el.closest)return;var control=el.closest('[id^=\"gform_submit_button_\"]');if(control)attempt(control.closest('form'),null,'submit');},true);\nfunction confirmationNode(node){if(modernHookInstalled||!node||node.nodeType!==1)return;var nodes=[];if(node.matches&&node.matches('[id^=\"gform_confirmation_message_\"], [id^=\"gform_confirmation_wrapper_\"]'))nodes.push(node);if(node.querySelectorAll){var list=node.querySelectorAll('[id^=\"gform_confirmation_message_\"], [id^=\"gform_confirmation_wrapper_\"]');for(var i=0;i<list.length;i++)nodes.push(list[i]);}for(var j=0;j<nodes.length;j++){var match=/gform_confirmation_(?:message|wrapper)_(\\d+)/.exec(nodes[j].id||'');if(match&&!isNodeHidden(nodes[j]))fireLegacy(match[1]);}}\nif(typeof MutationObserver==='function')new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++)for(var j=0;j<mutations[i].addedNodes.length;j++)confirmationNode(mutations[i].addedNodes[j]);}).observe(document.body||document.documentElement,{childList:true,subtree:true});\nwindow.addEventListener('pagehide',function(){\n var markers=[];for(var id2 in pending)if(Object.prototype.hasOwnProperty.call(pending,id2)){var entry=pending[id2];if(entry.method!=='postback'||Date.now()-entry.time>10000||(!entry.trusted&&hasVisibleValidationErrors(entry.form)))continue;markers.push({id:id2,time:entry.time,path:entry.path});}\n if(markers.length)try{sessionStorage.setItem(markerKey,JSON.stringify(markers));}catch(e){}\n});\nfunction deferred(){if(modernHookInstalled)return;var markers;try{var raw=sessionStorage.getItem(markerKey);sessionStorage.removeItem(markerKey);markers=JSON.parse(raw||'[]');}catch(e){return;}if(!Array.isArray(markers))return;for(var i=0;i<markers.length;i++){var marker=markers[i],id=safeFormId(marker&&marker.id);if(!id||!marker.time||Date.now()-marker.time>60000)continue;if(hasServerRejectionMarkers(id))continue;if(hasConfirmationMessage(id)){pending[id]={};fireLegacy(id);}}}\nif(document.readyState==='loading')document.addEventListener('DOMContentLoaded',deferred);else deferred();\n\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Gravity Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "gravity_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Gravity Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-09-24 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - HubSpot Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - HubSpot Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectHubspotForms) return;\n window.__ctDetectHubspotForms = true;\n window.dataLayer = window.dataLayer || [];\n\n // Updated-editor conversions are keyed by HubSpot's documented conversion\n // ID. Legacy messages use event-object identity because their documented\n // callback payload has no conversion ID.\n var seenConversions = {};\n var seenLegacyEvents = typeof WeakSet === 'function' ? new WeakSet() : [];\n\n function fireConversion(formId, conversionId, acceptedContext) {\n var id = formId ? String(formId) : '';\n if (typeof conversionId !== 'string' || !conversionId) return false;\n var key = '$' + conversionId;\n if (seenConversions[key]) return false;\n seenConversions[key] = true;\n var handled = false;\n var adapter = window.__ctHubspotMethod2Handler;\n if (typeof adapter === 'function') {\n try {\n handled = adapter({\n formId: id,\n instanceId: acceptedContext && acceptedContext.instanceId || '',\n conversionId: conversionId,\n form: acceptedContext && acceptedContext.form || null\n }) === true;\n } catch (e) {\n handled = false;\n }\n }\n // The push is contained, and a conversion whose push failed is\n // forgotten, so a repeat of HubSpot's event can still count it.\n if (!handled) {\n try {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({ event: 'hubspot_form_submitted', form_id: id });\n } catch (e) {\n delete seenConversions[key];\n return false;\n }\n }\n return true;\n }\n\n function claimLegacyEvent(event) {\n if (!event || typeof event !== 'object') return false;\n if (seenLegacyEvents && typeof seenLegacyEvents.has === 'function') {\n if (seenLegacyEvents.has(event)) return false;\n seenLegacyEvents.add(event);\n return true;\n }\n if (seenLegacyEvents.indexOf(event) !== -1) return false;\n seenLegacyEvents.push(event);\n return true;\n }\n\n function releaseLegacyEvent(event) {\n try {\n if (typeof seenLegacyEvents.delete === 'function') { seenLegacyEvents.delete(event); return; }\n var i = seenLegacyEvents.indexOf(event);\n if (i !== -1) seenLegacyEvents.splice(i, 1);\n } catch (e) {}\n }\n\n // ------------------------------------------------------------\n // Path 1: current forms editor (live-verified)\n // ------------------------------------------------------------\n // HubSpot dispatches this on the .hs-form-frame container and lets it bubble\n // (or on document itself when it cannot find the container), with\n // detail = { formId, instanceId }. It only ever follows a submission\n // HubSpot's server accepted. Listening on document in the capture phase\n // catches both dispatch points and cannot be silenced by page code that\n // stops the event's propagation further down.\n function hubspotFormsApi() {\n return window.HubSpotFormsV4 || window.HubspotFormsV4 || null;\n }\n\n function handleSubmissionSuccess(event) {\n try {\n var detail = event && event.detail;\n if (!detail || typeof detail.formId !== 'string' || !detail.formId) return;\n if (typeof detail.instanceId !== 'string' || !detail.instanceId) return;\n // When HubSpot's forms API is on the page, the event must name a form\n // instance HubSpot actually rendered here. A stray or malformed event\n // with a made-up instance id is ignored.\n var api = hubspotFormsApi();\n if (!api || typeof api.getFormFromEvent !== 'function') return;\n var form = api.getFormFromEvent(event);\n if (!form || typeof form.getFormId !== 'function' ||\n typeof form.getInstanceId !== 'function' ||\n typeof form.getConversionId !== 'function') return;\n if (form.getFormId() !== detail.formId ||\n form.getInstanceId() !== detail.instanceId) return;\n // HubSpot documents getConversionId as valid after successful\n // submission. It is the stable key for event replay and repeated submits.\n fireConversion(detail.formId, form.getConversionId(), { form: form, instanceId: detail.instanceId });\n } catch (e) {\n // Never throw back into HubSpot's own event dispatch.\n }\n }\n\n // ------------------------------------------------------------\n // Path 2: legacy forms editor (ported from the production module)\n // ------------------------------------------------------------\n // Legacy forms announce each lifecycle step with a postMessage of\n // { type: 'hsFormCallback', eventName, id, data }. Only 'onFormSubmitted'\n // means the submission was accepted; 'onFormSubmit' also fires for\n // submissions that then fail validation, so it is ignored.\n //\n // The legacy callback payload documents its form ID but not a safe mapping\n // from a cross-origin source WindowProxy to that ID. Accept only the inline\n // same-window callback; cross-origin iframe messages fail closed until a\n // vendor-supported source/form binding can be verified.\n function isTrustedOrigin(event) {\n return !!(event && event.source === window &&\n event.origin === window.location.origin);\n }\n\n function handleMessage(event) {\n try {\n // Reject an unbound source before even reading its structured-clone data.\n if (!isTrustedOrigin(event)) return;\n var data = event && event.data;\n if (!data || typeof data !== 'object') return;\n if (data.type !== 'hsFormCallback') return;\n if (data.eventName !== 'onFormSubmitted') return;\n var formId = data.id;\n if (typeof formId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(formId)) return;\n if (!claimLegacyEvent(event)) return;\n // The documented legacy callback runs after persistence, but has no\n // stable conversion ID. The local guard only recognizes replay of this\n // exact MessageEvent object; a distinct event object may be a replay or a\n // new conversion, so cross-event deduplication is not claimed.\n var handled = false;\n var adapter = window.__ctHubspotMethod2Handler;\n if (typeof adapter === 'function') {\n try {\n handled = adapter({ formId: formId, legacyEvent: event }) === true;\n } catch (e) { handled = false; }\n }\n if (!handled) {\n try {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({ event: 'hubspot_form_submitted', form_id: formId });\n } catch (e) {\n releaseLegacyEvent(event);\n }\n }\n } catch (e) {\n // Never throw back into the page's own message handling.\n }\n }\n\n document.addEventListener('hs-form-event:on-submission:success', handleSubmissionSuccess, true);\n window.addEventListener('message', handleMessage, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - HubSpot Form Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "hubspot_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - HubSpot Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Jotform",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Jotform Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n/* Jotform iframe completion listener. Reads no form answers.\n * Counts once per embedded frame on this page. */\n(function () {\n 'use strict';\n if (window.__ctDetectJotform || window.__ctJotformMethod2Installed) return;\n window.__ctDetectJotform = true;\n window.__ctJotformMethod2Installed = true;\n var completed = [];\n window.addEventListener('message', function (event) {\n if (!event.source || event.source === window) return;\n if (!/^https:\\/\\/(form|submit)\\.jotform\\.com$/.test(event.origin)) return;\n var data = event.data;\n if (!data || typeof data !== 'object' || Array.isArray(data) || data.action !== 'submission-completed') return;\n var frames = document.querySelectorAll('iframe');\n for (var i = 0; i < frames.length; i++) {\n var frame = frames[i];\n if (frame.contentWindow !== event.source) continue;\n var match = /^https:\\/\\/form\\.jotform\\.com\\/(\\d+)(?:[/?#]|$)/.exec(frame.getAttribute('src') || '');\n if (!match || (data.formID != null && String(data.formID) !== match[1])) return;\n if (completed.indexOf(frame) !== -1) return;\n completed.push(frame);\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({ event: 'jotform_form_submitted', form_id: match[1] });\n return;\n }\n });\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Jotform Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "jotform_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Jotform Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Ninja Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Ninja Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n var runtime = window.__ctNinjaFormsRuntime;\n if (runtime && runtime.installed) return;\n\n // Preserve the recipe's public duplicate-install guard. If a superseded\n // snippet already set it without this runtime, fail closed: don't layer a\n // second listener over an unknown old detector.\n if (!runtime && window.__ctDetectNinjaForms) return;\n\n if (!runtime) {\n runtime = { seenEntryIds: Object.create(null), installed: false };\n window.__ctNinjaFormsRuntime = runtime;\n }\n window.__ctDetectNinjaForms = true;\n window.dataLayer = window.dataLayer || [];\n\n var MISSING = {};\n var MAX_SAFE_INTEGER = 9007199254740991;\n\n // Read only own data properties. Callback payloads are normally parsed JSON,\n // but a filter or another page script can supply accessor-backed objects.\n // Do not execute getters while deciding whether a response proves a save.\n function ownDataValue(object, key) {\n if (!object || typeof object !== 'object' || !Object.prototype.hasOwnProperty.call(object, key)) return MISSING;\n if (typeof Object.getOwnPropertyDescriptor !== 'function') return MISSING;\n var descriptor = Object.getOwnPropertyDescriptor(object, key);\n if (!descriptor || !Object.prototype.hasOwnProperty.call(descriptor, 'value')) return MISSING;\n return descriptor.value;\n }\n\n function emptyErrors(value) {\n if (Object.prototype.toString.call(value) === '[object Array]') return value.length === 0;\n if (!value || typeof value !== 'object') return false;\n for (var key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) return false;\n }\n return true;\n }\n\n // Accept only primitive safe integers or canonical decimal strings. Never\n // coerce booleans, arrays, objects, boxed numbers, or accessor-backed IDs.\n function positiveIntegerId(value) {\n if (typeof value === 'number') {\n if (!isFinite(value) || value <= 0 || Math.floor(value) !== value || value > MAX_SAFE_INTEGER) return null;\n return String(value);\n }\n if (typeof value !== 'string' || !/^[1-9]\\d*$/.test(value)) return null;\n var number = Number(value);\n if (!isFinite(number) || number > MAX_SAFE_INTEGER || String(number) !== value) return null;\n return value;\n }\n\n function canonicalFormId(value) {\n var formId;\n if (typeof value === 'number') {\n if (!isFinite(value) || value <= 0 || Math.floor(value) !== value || value > MAX_SAFE_INTEGER) return null;\n formId = String(value);\n } else if (typeof value === 'string') {\n formId = value;\n } else {\n return null;\n }\n if (!/^[1-9]\\d*(?:_(?:0|[1-9]\\d*))*$/.test(formId)) return null;\n var parts = formId.split('_');\n for (var i = 0; i < parts.length; i++) {\n var part = Number(parts[i]);\n if (!isFinite(part) || part > MAX_SAFE_INTEGER || String(part) !== parts[i]) return null;\n }\n return formId;\n }\n\n function inspectResponse(response, callbackFormId) {\n var errors = ownDataValue(response, 'errors');\n if (errors === MISSING || !emptyErrors(errors)) return null;\n var data = ownDataValue(response, 'data');\n if (!data || typeof data !== 'object') return null;\n var halt = ownDataValue(data, 'halt');\n if (halt !== MISSING && halt) return null;\n var nestedErrors = ownDataValue(data, 'errors');\n if (nestedErrors !== MISSING && !emptyErrors(nestedErrors)) return null;\n var formValue = ownDataValue(data, 'form_id');\n var formId = formValue === MISSING ? null : canonicalFormId(formValue);\n if (!formId || canonicalFormId(callbackFormId) !== formId) return null;\n var actions = ownDataValue(data, 'actions');\n if (!actions || typeof actions !== 'object') return null;\n var save = ownDataValue(actions, 'save');\n if (!save || typeof save !== 'object') return null;\n var saveValue = ownDataValue(save, 'sub_id');\n var entryId = saveValue === MISSING ? null : positiveIntegerId(saveValue);\n if (!entryId) return null;\n return { formId: formId, entryId: entryId };\n }\n\n runtime.inspectResponse = inspectResponse;\n\n function handleSubmitResponse(response, textStatus, jqXHR, callbackFormId) {\n var accepted = inspectResponse(response, callbackFormId);\n if (!accepted) {\n if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {\n window.__ctNinjaMethod2AfterResponse(callbackFormId, false, false);\n }\n return;\n }\n\n var key = '$' + accepted.entryId;\n if (runtime.seenEntryIds[key]) {\n if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {\n window.__ctNinjaMethod2AfterResponse(accepted.formId, false, true);\n }\n return;\n }\n runtime.seenEntryIds[key] = true;\n\n var enriched = false;\n if (typeof window.__ctNinjaMethod2Emit === 'function') {\n try {\n enriched = window.__ctNinjaMethod2Emit(accepted.formId, accepted.entryId) === true;\n } catch (e) {\n enriched = false;\n }\n }\n if (!enriched) {\n window.dataLayer.push({ event: 'ninja_forms_submitted', form_id: accepted.formId });\n }\n if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {\n window.__ctNinjaMethod2AfterResponse(accepted.formId, true, false);\n }\n }\n\n function hookNfRadio() {\n if (runtime.installed) return true;\n var radio = typeof nfRadio !== 'undefined' && nfRadio.channel ? nfRadio :\n (typeof Backbone !== 'undefined' && Backbone.Radio ? Backbone.Radio : null);\n if (!radio) return false;\n try {\n radio.channel('forms').on('submit:response', handleSubmitResponse);\n runtime.installed = true;\n return true;\n } catch (e) {\n return false;\n }\n }\n\n if (!hookNfRadio()) {\n document.addEventListener('DOMContentLoaded', hookNfRadio);\n window.addEventListener('load', hookNfRadio);\n }\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Ninja Forms Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "ninja_forms_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Ninja Forms Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"containerVersion": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Phone call click",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Phone call click Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n if (window.__ctDetectPhoneClick) return;\n window.__ctDetectPhoneClick = true;\n window.dataLayer = window.dataLayer || [];\n\n // A click is a call INTENT, not a completed call. On desktop especially,\n // many tel: clicks never become a conversation. Count it as a lead signal,\n // and prefer a call tracking number if you need answered-call accuracy.\n\n // Ignore a repeat click on the same number inside this window. Impatient\n // double-taps on mobile are common and would otherwise double count.\n var DEDUPE_MS = 2000;\n var lastNumber = null;\n var lastAt = 0;\n\n function normalise(href) {\n // tel:+61 (2) 1234-5678 -> +61212345678 . Keeps a leading +, drops the\n // punctuation humans put in phone numbers so dedupe compares like for like.\n var raw = String(href || '').replace(/^tel:/i, '');\n try { raw = decodeURIComponent(raw); } catch (e) { /* leave as-is */ }\n var plus = raw.trim().charAt(0) === '+' ? '+' : '';\n return plus + raw.replace(/[^0-9]/g, '');\n }\n\n function handleClick(event) {\n try {\n // Left click only, and not a modified click that opens elsewhere.\n if (event.button !== undefined && event.button !== 0) return;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n\n var target = event.target;\n if (!target || !target.closest) return;\n\n // closest() because the click usually lands on an icon or span INSIDE\n // the anchor, not the anchor itself.\n var link = target.closest('a[href^=\"tel:\"], a[href^=\"TEL:\"]');\n if (!link) return;\n\n var number = normalise(link.getAttribute('href'));\n if (!number) return;\n\n var now = new Date().getTime();\n if (number === lastNumber && (now - lastAt) < DEDUPE_MS) return;\n lastNumber = number;\n lastAt = now;\n\n // PII: if the site shows visitor-specific numbers (an account page, a\n // CRM-driven \"your rep\" number), drop phone_number and link_text here.\n window.dataLayer.push({\n event: 'phone_click',\n phone_number: number,\n // The visible text, useful when a site shows different numbers per\n // location or campaign. Trimmed and capped so a whole button's worth\n // of markup text never lands in the dataLayer.\n link_text: (link.textContent || '').trim().slice(0, 100),\n page_path: window.location.pathname\n });\n } catch (e) {\n // Never throw back into the page's own click handling.\n }\n }\n\n // Bubble phase: a tel: click has no validation to lose a race with, and\n // bubbling means anything that legitimately cancels the click wins first.\n document.addEventListener('click', handleClick, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Phone call click",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "phone_click"
}
]
}
],
"filter": []
}
],
"variable": [],
"fingerprint": "0"
}
}
{
"exportFormatVersion": 2,
"exportTime": "2026-10-15 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Squarespace Forms",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Squarespace Forms Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n(function () {\n 'use strict';\n // Install once, even if GTM injects this tag more than once on the page.\n if (window.__ctDetectSquarespaceForms) return;\n window.__ctDetectSquarespaceForms = true;\n window.dataLayer = window.dataLayer || [];\n\n // Ported from a production module (cdn/v1/modules/\n // squarespace-forms.js, measured against a live Squarespace 7.1 site in\n // October 2026). Event only: it never reads what the visitor typed.\n //\n // What Squarespace does:\n // - The Form block renders a React form in the page (no iframe):\n // .sqs-block-form ... form.react-form-contents[novalidate]. It mounts\n // after DOMContentLoaded, so submits are caught on document.\n // - There is no check in the browser. Every submit posts\n // /api/form/FormSubmissionKey then /api/form/SaveFormSubmission, and the\n // server decides: 204 on success, 400 for a field error, 401 for a failed\n // reCAPTCHA. A submit is never a conversion on its own.\n // - On success it marks the form (react-form-contents--submitted), shows a\n // .form-submission-text message and gives the button the class\n // \"success\". A form set to redirect leaves for its page about 1.3\n // seconds after the 204, before that message renders in Chromium.\n // - The Newsletter block posts to the same SaveFormSubmission address, and\n // that request carries no form identity, so a save only counts for a\n // form that provably owns it.\n //\n // It fires once per form, on the first confirmed success for an attempt:\n // 1. a success marker that was not there when the attempt started, or\n // 2. the SaveFormSubmission request answering 2xx (read from the\n // browser's resource timing, where it exposes responseStatus), when\n // no other form's submit could own that save, or\n // 3. as the page leaves (a redirect form), either of the above.\n // It never fires on a 400 or 401, on a filled anti-spam field, or when it\n // cannot tell which form a save belongs to.\n\n var EVENT_NAME = 'squarespace_form_submitted';\n var BLOCK_SELECTOR = '.sqs-block-form, [data-sqsp-block=\"form\"], [data-definition-name=\"website.components.form\"]';\n var SAVE_PATH = '/api/form/SaveFormSubmission';\n // Long enough for a visitor to solve a reCAPTCHA picture challenge.\n var WATCH_MS = 180000;\n\n function now() {\n try {\n if (window.performance && typeof window.performance.now === 'function') return window.performance.now();\n } catch (e) {}\n return 0;\n }\n\n function hasToken(el, token) {\n if (!el || !el.getAttribute) return false;\n var cls = el.getAttribute('class') || '';\n return (' ' + cls + ' ').indexOf(' ' + token + ' ') !== -1;\n }\n\n function isConnected(el) {\n try {\n if (typeof el.isConnected === 'boolean') return el.isConnected;\n return !!(el.ownerDocument && el.ownerDocument.documentElement.contains(el));\n } catch (e) {\n return false;\n }\n }\n\n // ---- Which forms are Squarespace forms ----\n\n function blockFor(formEl) {\n try {\n return (formEl && formEl.closest) ? formEl.closest(BLOCK_SELECTOR) : null;\n } catch (e) {\n return null;\n }\n }\n\n function isSquarespaceForm(formEl) {\n if (!formEl || (formEl.tagName || '').toLowerCase() !== 'form') return false;\n return !!blockFor(formEl);\n }\n\n // The block's own form definition (the site owner's settings, not the\n // visitor's answers): { formId, formName, ... }.\n function formIdentity(block) {\n var id = { formId: '', formName: '' };\n try {\n var script = block && block.querySelector('script.sqs-form-block-context');\n if (!script) return id;\n var parsed = JSON.parse(script.textContent || '{}');\n if (parsed && typeof parsed.formId === 'string') id.formId = parsed.formId;\n if (parsed && typeof parsed.formName === 'string') id.formName = parsed.formName;\n } catch (e) {}\n return id;\n }\n\n // The honeypot is a text input visitors cannot see or reach (measured id\n // \"message-field\", inside an aria-hidden wrapper). Squarespace answers a\n // filled one with a 204 and its thank-you message, so a filled honeypot\n // means a bot. Only whether it is empty is checked.\n function honeypotFilled(formEl) {\n try {\n var hp = formEl.querySelector('#message-field');\n if (!hp) return false;\n var wrap = hp.closest && hp.closest('[aria-hidden=\"true\"]');\n if (!wrap || !formEl.contains(wrap)) return false;\n return hp.value !== '';\n } catch (e) {\n return false;\n }\n }\n\n function submitButtonOf(formEl) {\n try { return formEl.querySelector('button[type=\"submit\"]'); } catch (e) { return null; }\n }\n\n // ---- Which form a save request belongs to ----\n\n var seenSaves = []; // SaveFormSubmission resource entries seen so far\n var claimed = []; // entries already credited to a form\n var submitLog = []; // every form submit on the page, with its time\n\n function pageOrigin() {\n try {\n var l = window.location;\n return l.origin || (l.protocol + '//' + l.host);\n } catch (e) {\n return '';\n }\n }\n\n // The save request's address is checked for its origin and path only.\n function isSaveEntry(e) {\n var n = (e && e.name) || '';\n var origin = pageOrigin();\n if (!origin || n.indexOf(origin + '/') !== 0) return false;\n return n.slice(origin.length).split(/[?#]/)[0] === SAVE_PATH;\n }\n\n function prune() {\n // An attempt is watched for WATCH_MS, and submits up to WATCH_MS before\n // it still count when deciding who owns a save.\n var cutoff = now() - 2 * WATCH_MS;\n var i;\n for (i = submitLog.length - 1; i >= 0; i--) if (submitLog[i].at < cutoff) submitLog.splice(i, 1);\n for (i = seenSaves.length - 1; i >= 0; i--) if (seenSaves[i].startTime < cutoff) seenSaves.splice(i, 1);\n if (seenSaves.length > 100) seenSaves.splice(0, seenSaves.length - 100);\n if (claimed.length > 100) claimed.splice(0, claimed.length - 100);\n }\n\n function allSaveEntries() {\n var all = seenSaves.slice();\n try {\n if (window.performance && typeof window.performance.getEntriesByType === 'function') {\n var buffered = window.performance.getEntriesByType('resource');\n for (var b = 0; b < buffered.length; b++) if (all.indexOf(buffered[b]) === -1) all.push(buffered[b]);\n }\n } catch (err) {}\n var out = [];\n for (var i = 0; i < all.length; i++) if (isSaveEntry(all[i])) out.push(all[i]);\n return out;\n }\n\n function saveEntriesSince(since) {\n var all = allSaveEntries();\n var out = [];\n for (var i = 0; i < all.length; i++) {\n if (all[i].startTime >= since && claimed.indexOf(all[i]) === -1) out.push(all[i]);\n }\n out.sort(function (x, y) { return x.startTime - y.startTime; });\n return out;\n }\n\n // A save's owner is ambiguous when another form (a Newsletter block\n // included) was submitted during this attempt. It is also ambiguous when\n // another form was submitted earlier in the watch window and may still be\n // waiting for its save, because a slow reCAPTCHA can hold that save back\n // until after this attempt starts. Each submit gets at most one save, so\n // fewer saves than submits before this attempt means one is outstanding.\n function saveOwnershipAmbiguous(formEl, since, until) {\n var other = false;\n var first = null;\n var submits = 0;\n for (var i = 0; i < submitLog.length; i++) {\n var s = submitLog[i];\n if (s.at > until || s.at < since - WATCH_MS) continue;\n if (s.at >= since) {\n if (s.form !== formEl) return true;\n continue;\n }\n if (s.form !== formEl) other = true;\n submits++;\n if (first === null || s.at < first) first = s.at;\n }\n if (!other) return false;\n var saves = allSaveEntries();\n var answered = 0;\n for (var j = 0; j < saves.length; j++) {\n if (saves[j].startTime >= first && saves[j].startTime < since) answered++;\n }\n return answered < submits;\n }\n\n function statusOf(entry) {\n var s = entry && entry.responseStatus;\n return (typeof s === 'number' && s > 0) ? s : null;\n }\n\n // ---- One watcher per form ----\n\n var watchers = [];\n var firedForms = [];\n\n function findWatcher(formEl) {\n for (var i = 0; i < watchers.length; i++) if (watchers[i].form === formEl) return watchers[i];\n return null;\n }\n\n function removeWatcher(w) {\n for (var i = 0; i < watchers.length; i++) if (watchers[i] === w) { watchers.splice(i, 1); return; }\n }\n\n function dropStaleWatchers(formEl, block) {\n for (var i = watchers.length - 1; i >= 0; i--) {\n var w = watchers[i];\n if (w.form === formEl) continue;\n if (!isConnected(w.form) || (block && w.block === block)) w.cleanup();\n }\n }\n\n function createWatcher(formEl, block) {\n var scope = (formEl.closest && formEl.closest('.form-wrapper')) || block;\n function markers() {\n var text = false;\n try { text = !!(scope && scope.querySelector('.form-submission-text')); } catch (e) {}\n return {\n submitted: hasToken(formEl, 'react-form-contents--submitted'),\n button: hasToken(submitButtonOf(formEl), 'success'),\n text: text\n };\n }\n var w = {\n form: formEl,\n block: block,\n identity: formIdentity(block),\n armed: false,\n submitAt: 0,\n answered: true,\n done: false,\n timer: null,\n observer: null,\n pagehideArmed: false,\n staleError: false,\n had: markers()\n };\n\n function redirectConfigured() {\n try { return !!(formEl.getAttribute && formEl.getAttribute('data-success-redirect')); } catch (e) { return false; }\n }\n\n function cleanup() {\n w.done = true;\n if (w.timer) { try { clearTimeout(w.timer); } catch (e) {} w.timer = null; }\n if (w.observer) { try { w.observer.disconnect(); } catch (e) {} w.observer = null; }\n if (w.pagehideArmed) {\n try { window.removeEventListener('pagehide', onPageHide, true); } catch (e) {}\n w.pagehideArmed = false;\n }\n removeWatcher(w);\n }\n\n // The push comes first. The form is marked done only once the push went\n // through, so a dataLayer that throws (a broken wrapper) loses nothing,\n // and the next confirmation tries again.\n function fire() {\n if (w.done) return false;\n var payload = { event: EVENT_NAME, form_id: w.identity.formId };\n if (w.identity.formName) payload.form_name = w.identity.formName;\n try {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(payload);\n } catch (e) {\n return false;\n }\n cleanup();\n firedForms.push(formEl);\n return true;\n }\n\n function domConfirmsSuccess() {\n var m = markers();\n return (m.submitted && !w.had.submitted) || (m.button && !w.had.button) || (m.text && !w.had.text);\n }\n\n function check() {\n if (w.done || !w.armed) return;\n if (!isConnected(formEl)) { cleanup(); return; }\n if (domConfirmsSuccess()) { fire(); return; }\n if (w.answered) return;\n // A fresh error state on the button is Squarespace refusing this\n // attempt; one left over from an earlier attempt is not.\n var errorShowing = hasToken(submitButtonOf(formEl), 'error');\n if (!errorShowing) w.staleError = false;\n else if (!w.staleError) w.answered = true;\n }\n\n // A failure in any callback stays inside this listener and never\n // reaches Squarespace's page.\n function onPageHide() {\n try { pageHideCheck(); } catch (e) {}\n }\n\n function pageHideCheck() {\n if (w.done || !w.armed) return;\n if (!isConnected(formEl)) { cleanup(); return; }\n if (domConfirmsSuccess()) { fire(); return; }\n if (saveOwnershipAmbiguous(formEl, w.submitAt, now())) { cleanup(); return; }\n var entries = saveEntriesSince(w.submitAt);\n var last = entries[entries.length - 1];\n var status = statusOf(last);\n if (status !== null && status >= 200 && status < 300) {\n if (fire()) claimed.push(last);\n else cleanup();\n return;\n }\n cleanup();\n }\n\n w.refresh = function (submitAt) {\n // A new attempt replaces the old one once the old one was answered\n // (or its save has been seen); a double submit keeps the first.\n if (!w.armed || w.answered || saveEntriesSince(w.submitAt).length > 0) {\n w.submitAt = submitAt;\n w.answered = false;\n w.staleError = hasToken(submitButtonOf(formEl), 'error');\n }\n w.armed = true;\n if (w.timer) { try { clearTimeout(w.timer); } catch (e) {} }\n try { w.timer = setTimeout(cleanup, WATCH_MS); } catch (e) {}\n if (!w.pagehideArmed && redirectConfigured()) {\n try {\n window.addEventListener('pagehide', onPageHide, true);\n w.pagehideArmed = true;\n } catch (e) {}\n }\n };\n w.check = check;\n w.fire = fire;\n w.cleanup = cleanup;\n w.alive = function () { return isConnected(formEl); };\n w.markAnswered = function () { w.answered = true; };\n\n try {\n if (typeof MutationObserver !== 'undefined' && block) {\n w.observer = new MutationObserver(function () {\n try { check(); } catch (e) {}\n });\n w.observer.observe(block, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n }\n } catch (e) {}\n watchers.push(w);\n return w;\n }\n\n // ---- The save request's verdict, from resource timing ----\n\n function onResourceEntries(list) {\n var entries;\n try { entries = list.getEntries(); } catch (e) { return; }\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i];\n if (!e || !isSaveEntry(e)) continue;\n if (seenSaves.indexOf(e) === -1) { seenSaves.push(e); prune(); }\n var status = statusOf(e);\n if (status === null || claimed.indexOf(e) !== -1) continue;\n var candidates = [];\n for (var j = 0; j < watchers.length; j++) {\n var w = watchers[j];\n if (!w.done && w.armed && !w.answered && w.alive() && e.startTime >= w.submitAt) candidates.push(w);\n }\n if (candidates.length !== 1) continue;\n var c = candidates[0];\n if (saveOwnershipAmbiguous(c.form, c.submitAt, e.startTime)) continue;\n if (status >= 200 && status < 300) {\n if (c.fire()) claimed.push(e);\n } else {\n c.markAnswered();\n }\n }\n }\n\n // ---- Submits ----\n\n function handleSubmit(event) {\n try {\n var formEl = event.target;\n if (!formEl || (formEl.tagName || '').toLowerCase() !== 'form') return;\n submitLog.push({ form: formEl, at: now() });\n prune();\n if (!isSquarespaceForm(formEl)) return;\n var block = blockFor(formEl);\n dropStaleWatchers(formEl, block);\n // Squarespace allows one success per page view.\n if (firedForms.indexOf(formEl) !== -1) return;\n if (hasToken(formEl, 'react-form-contents--submitted')) return;\n if (honeypotFilled(formEl)) {\n var old = findWatcher(formEl);\n if (old) old.cleanup();\n return;\n }\n var w = findWatcher(formEl) || createWatcher(formEl, block);\n w.refresh(now());\n } catch (e) {\n // Never throw back into Squarespace's own form handling.\n }\n }\n\n document.addEventListener('submit', handleSubmit, true);\n try {\n if (typeof PerformanceObserver !== 'undefined') {\n new PerformanceObserver(function (list) {\n try { onResourceEntries(list); } catch (e) {}\n }).observe({ type: 'resource' });\n }\n } catch (e) {}\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Squarespace Form Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "squarespace_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Squarespace Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "2",
"name": "DLV - Squarespace Form Name",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_name"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}{
"exportFormatVersion": 2,
"exportTime": "2026-07-02 00:00:00",
"containerVersion": {
"path": "accounts/0/containers/0/versions/0",
"accountId": "0",
"containerId": "0",
"containerVersionId": "0",
"container": {
"path": "accounts/0/containers/0",
"accountId": "0",
"containerId": "0",
"name": "Conversion Detection - Tally",
"publicId": "GTM-XXXXXXX",
"usageContext": [
"WEB"
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
},
"tag": [
{
"accountId": "0",
"containerId": "0",
"tagId": "1",
"name": "Conversion Detection - Tally Submission Listener",
"type": "html",
"parameter": [
{
"type": "TEMPLATE",
"key": "html",
"value": "<script>\n/* Tally Submission Listener. Reads only the envelope of Tally's\n * own submission message; it does not decode or read answer values and never\n * pushes answers. */\n(function () {\n 'use strict';\n if (window.__ctDetectTally || window.__ctTallyMethod2Installed) return;\n window.__ctDetectTally = true;\n // Keep the historical Method 2 marker as a one-way compatibility alias.\n // The separate Method 2 adapter has its own marker and can still register\n // after this core is already installed.\n window.__ctTallyMethod2Installed = true;\n window.dataLayer = window.dataLayer || [];\n\n function isWs(c) { return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'; }\n function skipWs(s, p) { while (p.i < s.length && isWs(s.charAt(p.i))) p.i++; }\n function stringEnd(s, p, decode) {\n if (s.charAt(p.i) !== '\"') throw new Error('string');\n var start = p.i++;\n while (p.i < s.length) {\n var c = s.charAt(p.i++);\n if (c === '\"') {\n if (!decode) return null;\n // Decode only object keys and allowlisted envelope metadata strings.\n return JSON.parse(s.slice(start, p.i));\n }\n if (c.charCodeAt(0) < 0x20) throw new Error('control');\n if (c === '\\\\') {\n if (p.i >= s.length) throw new Error('escape end');\n var esc = s.charAt(p.i++);\n if ('\"\\\\/bfnrt'.indexOf(esc) !== -1) continue;\n if (esc !== 'u' || !/^[0-9a-fA-F]{4}$/.test(s.slice(p.i, p.i + 4))) throw new Error('escape');\n p.i += 4;\n }\n }\n throw new Error('unterminated');\n }\n function skipValue(s, p, depth) {\n if (depth > 32) throw new Error('depth');\n skipWs(s, p);\n var c = s.charAt(p.i);\n if (c === '\"') { stringEnd(s, p, false); return; }\n if (c === '{') {\n p.i++; skipWs(s, p); if (s.charAt(p.i) === '}') { p.i++; return; }\n while (p.i < s.length) {\n skipWs(s, p); stringEnd(s, p, false); skipWs(s, p);\n if (s.charAt(p.i++) !== ':') throw new Error('colon');\n skipValue(s, p, depth + 1); skipWs(s, p);\n var sep = s.charAt(p.i++); if (sep === '}') return; if (sep !== ',') throw new Error('object');\n }\n throw new Error('object end');\n }\n if (c === '[') {\n p.i++; skipWs(s, p); if (s.charAt(p.i) === ']') { p.i++; return; }\n while (p.i < s.length) {\n skipValue(s, p, depth + 1); skipWs(s, p);\n var a = s.charAt(p.i++); if (a === ']') return; if (a !== ',') throw new Error('array');\n }\n throw new Error('array end');\n }\n var begin = p.i;\n while (p.i < s.length && !isWs(s.charAt(p.i)) && ',}]'.indexOf(s.charAt(p.i)) === -1) p.i++;\n if (p.i === begin) throw new Error('value');\n var token = s.slice(begin, p.i);\n if (token !== 'true' && token !== 'false' && token !== 'null' &&\n !/^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$/.test(token)) throw new Error('primitive');\n }\n function readStringValue(s, p) { skipWs(s, p); return stringEnd(s, p, true); }\n function readMetadataObject(s, p, wanted, out) {\n skipWs(s, p); if (s.charAt(p.i++) !== '{') throw new Error('metadata object');\n skipWs(s, p); if (s.charAt(p.i) === '}') { p.i++; return; }\n while (p.i < s.length) {\n skipWs(s, p); var key = stringEnd(s, p, true); skipWs(s, p);\n if (s.charAt(p.i++) !== ':') throw new Error('metadata colon');\n if (wanted[key]) { out[key] = readStringValue(s, p); }\n else if (key === 'fields') { skipWs(s, p); if (s.charAt(p.i) !== '[') throw new Error('fields shape'); skipValue(s, p, 0); out.fieldsArray = true; }\n else skipValue(s, p, 0);\n skipWs(s, p); var sep = s.charAt(p.i++); if (sep === '}') return; if (sep !== ',') throw new Error('metadata separator');\n }\n throw new Error('metadata end');\n }\n function readEnvelope(s) {\n if (typeof s !== 'string' || s.length > 1048576) return null;\n var p = { i: 0 }, out = {}, payload = {};\n try {\n skipWs(s, p); if (s.charAt(p.i++) !== '{') return null;\n skipWs(s, p); if (s.charAt(p.i) === '}') return null;\n while (p.i < s.length) {\n skipWs(s, p); var key = stringEnd(s, p, true); skipWs(s, p);\n if (s.charAt(p.i++) !== ':') return null;\n if (key === 'event') out.event = readStringValue(s, p);\n else if (key === 'payload') readMetadataObject(s, p, { id: true, formId: true }, payload);\n else skipValue(s, p, 0);\n skipWs(s, p); var sep = s.charAt(p.i++); if (sep === '}') break; if (sep !== ',') return null;\n }\n skipWs(s, p); if (p.i !== s.length) return null;\n if (out.event !== 'Tally.FormSubmitted') return null;\n if (!payload.id || !payload.formId || !payload.fieldsArray || !/^[-A-Za-z0-9_]{1,128}$/.test(payload.id) || !/^[-A-Za-z0-9_]{1,128}$/.test(payload.formId)) return null;\n return { id: payload.id, formId: payload.formId };\n } catch (e) { return null; }\n }\n function isTallyOrigin(origin) {\n return typeof origin === 'string' && /^https:\\/\\/tally\\.so(?::443)?$/i.test(origin);\n }\n // Bind only fixed-host iframe paths using CSS attribute selectors. Do not\n // retrieve src or data-tally-src: either may contain prefilled respondent\n // data in its query. Only a materialized iframe src is supported here; a\n // deferred attribute without a loaded src fails closed.\n function frameFormId(frame, expectedFormId) {\n if (!/^[-A-Za-z0-9_]{1,128}$/.test(expectedFormId || '') ||\n !frame || typeof frame.matches !== 'function') return '';\n var found = false;\n var modes = ['embed', 'r', 'popup'];\n for (var i = 0; i < modes.length; i++) {\n var base = 'https://tally.so/' + modes[i] + '/' + expectedFormId;\n var selectors = [\n 'iframe[src=\"' + base + '\"]',\n 'iframe[src^=\"' + base + '?\"]',\n 'iframe[src^=\"' + base + '#\"]'\n ];\n for (var j = 0; j < selectors.length; j++) {\n try { if (frame.matches(selectors[j])) { found = true; break; } }\n catch (e) { return ''; }\n }\n if (found) return expectedFormId;\n }\n return '';\n }\n function renderedFrameFormId(source, expectedFormId) {\n if (!source || source === window) return '';\n var frames;\n try { frames = document.getElementsByTagName('iframe'); } catch (e) { return ''; }\n for (var i = 0; frames && i < frames.length; i++) {\n try {\n if (frames[i].contentWindow === source) {\n // The event carries only a bounded public form ID. The selector tests\n // the fixed-host path and exact delimiter without exposing the URL.\n return frameFormId(frames[i], expectedFormId);\n }\n } catch (e) {}\n }\n return '';\n }\n var seen = Object.create(null);\n window.addEventListener('message', function (event) {\n try {\n if (!event || !isTallyOrigin(event.origin)) return;\n var verdict = readEnvelope(event.data);\n if (!verdict) return;\n var configuredFormId = renderedFrameFormId(event.source, verdict.formId);\n if (!configuredFormId || verdict.formId !== configuredFormId) return;\n var key = verdict.formId + ':' + verdict.id;\n if (seen[key]) return;\n seen[key] = true;\n var handled = false;\n var adapter = window.__ctTallyMethod2Handler;\n if (typeof adapter === 'function') {\n try { handled = adapter(event, verdict) === true; } catch (e) { handled = false; }\n }\n if (!handled) window.dataLayer.push({ event: 'tally_form_submitted', form_id: verdict.formId, submission_id: verdict.id });\n } catch (e) {}\n }, false);\n})();\n</script>"
},
{
"type": "BOOLEAN",
"key": "supportDocumentWrite",
"value": "false"
}
],
"firingTriggerId": [
"2147479553"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
},
"consentSettings": {
"consentStatus": "NOT_SET"
}
}
],
"trigger": [
{
"accountId": "0",
"containerId": "0",
"triggerId": "2",
"name": "CE - Tally Form Submitted",
"type": "CUSTOM_EVENT",
"customEventFilter": [
{
"type": "EQUALS",
"parameter": [
{
"type": "TEMPLATE",
"key": "arg0",
"value": "{{_event}}"
},
{
"type": "TEMPLATE",
"key": "arg1",
"value": "tally_form_submitted"
}
]
}
],
"filter": []
}
],
"variable": [
{
"accountId": "0",
"containerId": "0",
"variableId": "1",
"name": "DLV - Tally Form ID",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_id"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
},
{
"accountId": "0",
"containerId": "0",
"variableId": "3",
"name": "DLV - Tally Form Name",
"type": "v",
"parameter": [
{
"type": "TEMPLATE",
"key": "name",
"value": "form_name"
},
{
"type": "INTEGER",
"key": "dataLayerVersion",
"value": "2"
}
]
}
],
"fingerprint": "0",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/0/containers/0/workspaces/0"
}
}Sets campaign structure, budget and targeting on Google, Meta and more.
Decides what to measure and plans GA4 events and UTM rules.
Works out which channels actually drive signups and revenue.