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/divi-forms.js
View on GitHub/*! Divi Forms conversion detection (MIT)
* Detects: form submission. Pushes dataLayer event: divi_form_submitted
* From the conversion-tracking skill in Marketing Skills */
(function () {
if (window.__ctDetectDiviForms) return;
window.__ctDetectDiviForms = true;
window.dataLayer = window.dataLayer || [];
var reported = typeof WeakSet === 'function' ? new WeakSet() : null;
function inspect(container) {
if (!container || !container.querySelector) return;
var notice;
try {
notice = container.querySelector('.et-pb-contact-message.et_pb_success_message');
if (!notice || container.querySelector('form.et_pb_contact_form') ||
container.querySelector('.et_pb_contact_error_meesage') ||
container.querySelector('.et_contact_error')) return;
} catch (e) { return; }
if (reported && reported.has(notice)) return;
if (reported) reported.add(notice);
var id = container.id || (container.getAttribute && container.getAttribute('data-id')) || '';
if (!id) return;
var adapter = window.__ctDiviMethod2Emit;
if (typeof adapter === 'function' && adapter(container, String(id)) === true) return;
window.dataLayer.push({ event: 'divi_form_submitted', form_id: String(id) });
}
function observe(container) {
if (!container || container.__ctDiviObserved || typeof MutationObserver === 'undefined') return;
container.__ctDiviObserved = true;
new MutationObserver(function () { inspect(container); }).observe(container,
{ childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });
inspect(container);
}
function start() {
var existing = document.querySelectorAll('.et_pb_contact_form_container');
for (var i = 0; i < existing.length; i++) observe(existing[i]);
if (typeof MutationObserver !== 'undefined' && document.documentElement) {
new MutationObserver(function (records) {
for (var r = 0; r < records.length; r++) {
for (var n = 0; n < records[r].addedNodes.length; n++) {
var node = records[r].addedNodes[n];
if (node.nodeType !== 1) continue;
if (node.matches && node.matches('.et_pb_contact_form_container')) observe(node);
var nested = node.querySelectorAll ? node.querySelectorAll('.et_pb_contact_form_container') : [];
for (var j = 0; j < nested.length; j++) observe(nested[j]);
}
}
}).observe(document.documentElement, { childList: true, subtree: true });
}
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });
else start();
})();
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 |