Skip to content

coreyhaines31/marketingskills / skills/conversion-tracking

conversion-tracking

Verified

When the user wants to set up, audit, or fix conversion tracking to Google Ads, Meta, GA4, LinkedIn, and TikTok, or asks why conversions are missing or doubled: GTM, pixels, CAPI, Enhanced Conversions, offline imports. Fire on confirmed success, not the submit click; verify a test conversion arrives; diagnose before changing; offer free paths and disclose partner tools. For tracking plans, see analytics. For attribution, see attribution. For bidding, see ads.

FileKindSize
SKILL.mdskill md29.8 KB
assets/gtm-recipes/README.mdmarkdown6.3 KB
assets/gtm-recipes/detect/detect-acuity-scheduling.jsonconfig7.0 KB
assets/gtm-recipes/detect/detect-cal-com.jsonconfig8.8 KB
assets/gtm-recipes/detect/detect-calendly.jsonconfig7.7 KB
assets/gtm-recipes/detect/detect-contact-form-7.jsonconfig6.3 KB
assets/gtm-recipes/detect/detect-divi-forms.jsonconfig5.0 KB
assets/gtm-recipes/detect/detect-elementor-forms.jsonconfig4.4 KB
assets/gtm-recipes/detect/detect-file-download.jsonconfig5.0 KB
assets/gtm-recipes/detect/detect-fluent-forms.jsonconfig6.8 KB
assets/gtm-recipes/detect/detect-formidable-forms.jsonconfig10.8 KB
assets/gtm-recipes/detect/detect-forminator.jsonconfig5.5 KB
assets/gtm-recipes/detect/detect-framer-forms.jsonconfig6.3 KB
assets/gtm-recipes/detect/detect-generic-ajax-form.jsonconfig7.8 KB
assets/gtm-recipes/detect/detect-gravity-forms.jsonconfig15.4 KB
assets/gtm-recipes/detect/detect-hubspot-forms.jsonconfig9.3 KB
assets/gtm-recipes/detect/detect-jotform.jsonconfig3.8 KB
assets/gtm-recipes/detect/detect-ninja-forms.jsonconfig8.4 KB
assets/gtm-recipes/detect/detect-phone-click.jsonconfig4.6 KB
assets/gtm-recipes/detect/detect-squarespace-forms.jsonconfig18.5 KB
assets/gtm-recipes/detect/detect-tally.jsonconfig10.4 KB
assets/gtm-recipes/detect/detect-thank-you-page.jsonconfig6.2 KB
assets/gtm-recipes/detect/detect-typeform.jsonconfig7.9 KB
assets/gtm-recipes/detect/detect-webflow-forms.jsonconfig5.6 KB
assets/gtm-recipes/detect/detect-wix-forms.jsonconfig9.5 KB
assets/gtm-recipes/detect/detect-wix-scheduling.jsonconfig5.1 KB
assets/gtm-recipes/detect/detect-wpforms.jsonconfig11.1 KB
assets/gtm-recipes/detect/detect-ws-form.jsonconfig4.7 KB
assets/gtm-recipes/event-map.jsonconfig3.1 KB
assets/gtm-recipes/send/ga4.jsonconfig1.8 KB
assets/gtm-recipes/send/google-ads.jsonconfig2.7 KB
assets/gtm-recipes/send/linkedin.jsonconfig3.8 KB
assets/gtm-recipes/send/meta.jsonconfig4.1 KB
assets/gtm-recipes/send/microsoft.jsonconfig4.0 KB
assets/gtm-recipes/send/tiktok.jsonconfig4.4 KB
assets/snippets/README.mdmarkdown17.3 KB
assets/snippets/acuity-scheduling-field.htmlother1.3 KB
assets/snippets/acuity-scheduling.jsscript3.3 KB
assets/snippets/cal-com.jsscript5.5 KB
assets/snippets/calendly.jsscript4.8 KB
assets/snippets/contact-form-7.jsscript3.9 KB
assets/snippets/divi-forms.jsscript2.6 KB
assets/snippets/elementor-forms.jsscript2.0 KB
assets/snippets/file-download.jsscript3.2 KB
assets/snippets/fluent-forms.jsscript4.3 KB
assets/snippets/formidable-forms.jsscript8.2 KB
assets/snippets/forminator.jsscript3.1 KB
assets/snippets/framer-forms.jsscript3.9 KB
assets/snippets/generic-ajax-form.jsscript5.9 KB
assets/snippets/gravity-forms.jsscript12.8 KB
assets/snippets/hubspot-forms.jsscript6.8 KB
assets/snippets/jotform.jsscript1.4 KB
assets/snippets/ninja-forms.jsscript5.9 KB
assets/snippets/phone-click.jsscript2.8 KB
assets/snippets/squarespace-forms.jsscript15.3 KB
assets/snippets/tally.jsscript7.5 KB
assets/snippets/thank-you-page.jsscript4.3 KB
assets/snippets/typeform.jsscript5.0 KB
assets/snippets/webflow-forms.jsscript3.2 KB
assets/snippets/wix-forms.jsscript7.0 KB
assets/snippets/wix-scheduling.jsscript2.7 KB
assets/snippets/wpforms.jsscript8.6 KB
assets/snippets/ws-form.jsscript2.3 KB
evals/evals.jsonconfig21.0 KB
references/audit-playbook.mdmarkdown12.6 KB
references/browser-side.mdmarkdown22.5 KB
references/conversion-moments.mdmarkdown31.3 KB
references/discrepancies.mdmarkdown13.4 KB
references/ecommerce-platforms.mdmarkdown9.9 KB
references/google-ads.mdmarkdown29.6 KB
references/meta.mdmarkdown17.8 KB
references/other-platforms.mdmarkdown19.5 KB
references/server-side.mdmarkdown31.2 KB
scripts/build_recipe.pyscript10.8 KB
scripts/check_recipes.pyexecutablescript3.2 KB

assets/snippets/framer-forms.js

View on GitHub
/*! Framer Forms conversion detection (MIT)
 *  Detects: form submission. Pushes dataLayer event: framer_form_submitted
 *  From the conversion-tracking skill in Marketing Skills */
(function () {
  if (window.__ctFramerForms) return;
  window.__ctFramerForms = true;
  window.dataLayer = window.dataLayer || [];
  var listeners = [];
  var pending = [];
  window.__ctFramerSubscribe = function (listener) {
    if (listener && typeof listener === 'object') listeners.push(listener);
  };
  function isFramerForm(form) {
    try {
      if (!form || String(form.tagName || '').toLowerCase() !== 'form') return false;
      if (form.hasAttribute && form.hasAttribute('data-framer-name')) return true;
      if (typeof form.className === 'string' && /(^|\s)framer-[A-Za-z0-9_-]+/.test(form.className)) return true;
      return !!(form.closest && (form.closest('[data-framer-component-type]') || form.closest('[data-framer-name]')));
    } catch (e) { return false; }
  }
  function notify(phase, form, candidate) {
    var handled = false;
    for (var i = 0; i < listeners.length; i++) {
      try {
        var fn = listeners[i] && listeners[i][phase];
        if (typeof fn === 'function' && fn(form, candidate) === true) handled = true;
      } catch (e) {}
    }
    return handled;
  }
  function remember(form) {
    try {
      if (!isFramerForm(form)) return;
      for (var i = 0; i < pending.length; i++) {
        if (pending[i].form === form) return;
      }
      pending.push({ form: form, time: Date.now(), claimed: false });
      notify('beforeAttempt', form, false);
    } catch (e) {}
  }
  function finish(attempts, accepted) {
    for (var i = 0; i < attempts.length; i++) {
      var index = pending.indexOf(attempts[i]);
      if (index !== -1) pending.splice(index, 1);
    }
    if (!accepted) return;
    // Concurrent forms cannot be attributed without inspecting answers.
    // Keep those submissions event-only, with no guessed form name.
    var form = attempts.length === 1 ? attempts[0].form : null;
    var name = form ? form.getAttribute('data-framer-name') || form.id || '' : '';
    if (!form || !notify('onCandidate', form, true)) {
      window.dataLayer.push({ event: 'framer_form_submitted', form_name: name });
    }
  }
  if (typeof window.fetch === 'function') {
    var originalFetch = window.fetch;
    window.fetch = function (input, options) {
      var attempts = null;
      try {
        var url = typeof input === 'string' ? input : input && input.url;
        var method = options && options.method || input && input.method || 'GET';
        if (String(method).toUpperCase() === 'POST' && /^https:\/\/api\.framer\.com\/forms\/v1\/forms\/[a-f0-9-]+\/submit(?:\?.*)?$/.test(url || '')) {
          attempts = [];
          var now = Date.now();
          pending = pending.filter(function (attempt) { return now - attempt.time < 60000; });
          for (var i = 0; i < pending.length; i++) {
            if (!pending[i].claimed) {
              pending[i].claimed = true;
              attempts.push(pending[i]);
            }
          }
        }
      } catch (e) {}
      var result = originalFetch.apply(this, arguments);
      if (attempts) result.then(function (response) {
        try { finish(attempts, response.ok === true); } catch (e) {}
      }, function () {
        try { finish(attempts, false); } catch (e) {}
      });
      return result;
    };
  }
  if (typeof document !== 'undefined' && document.addEventListener) {
    document.addEventListener('submit', function (event) { remember(event.target); }, true);
    // Framer handles Enter directly instead of dispatching native submit.
    document.addEventListener('keydown', function (event) {
      var target = event.target;
      if (event.key === 'Enter' && target && String(target.tagName).toLowerCase() !== 'textarea') {
        var form = target.form;
        if (isFramerForm(form) && form.matches(':valid')) remember(form);
      }
    }, true);
  }
})();
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall