coreyhaines31/marketingskills / skills/conversion-tracking
conversion-tracking
VerifiedWhen 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.
assets/snippets/elementor-forms.js
View on GitHub/*! Elementor Forms conversion detection (MIT)
* Detects: form submission. Pushes dataLayer event: elementor_form_submitted
* From the conversion-tracking skill in Marketing Skills */
(function () {
if (window.__ctDetectElementorForms) return;
window.__ctDetectElementorForms = true;
window.dataLayer = window.dataLayer || [];
var seenEvents = typeof WeakSet === 'function' ? new WeakSet() : null;
function formFrom(target) {
try {
if (!target || target === document || target === window) return null;
if (target.matches && target.matches('form.elementor-form')) return target;
return target.closest ? target.closest('form.elementor-form') : null;
} catch (e) { return null; }
}
function formId(form) {
if (!form) return '';
if (form.id) return form.id;
var name = form.getAttribute && form.getAttribute('name');
if (name && name !== 'New Form') return name;
var widget = form.closest && form.closest('[data-id]');
return widget && widget.getAttribute('data-id') || '';
}
function onSuccess(event) {
if (event && seenEvents) {
if (seenEvents.has(event)) return;
seenEvents.add(event);
}
var form = formFrom(event && event.target);
var id = formId(form);
if (!form || !id) return;
var adapter = window.__ctElementorMethod2Emit;
if (typeof adapter === 'function') {
try { if (adapter(form, id) === true) return; }
catch (e) { return; }
}
window.dataLayer.push({ event: 'elementor_form_submitted', form_id: String(id) });
}
var handlerBound = false;
function hook() {
if (handlerBound) return true;
var jq = typeof jQuery !== 'undefined' ? jQuery : (typeof $ !== 'undefined' ? $ : null);
if (!jq) return false;
jq(document).on('submit_success', onSuccess);
handlerBound = true;
return true;
}
if (!hook()) {
document.addEventListener('DOMContentLoaded', hook, { once: true });
window.addEventListener('load', hook, { once: true });
}
})();
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |