add hidden UTM fields, capture from URL params, send in webhook
This commit is contained in:
+19
@@ -1819,6 +1819,11 @@
|
||||
<option value="france">France</option>
|
||||
</select>
|
||||
<input type="text" class="pricing-config-input" id="pricing-coupon" placeholder="Coupon code" />
|
||||
<input type="hidden" id="utm_source" />
|
||||
<input type="hidden" id="utm_medium" />
|
||||
<input type="hidden" id="utm_campaign" />
|
||||
<input type="hidden" id="utm_term" />
|
||||
<input type="hidden" id="utm_content" />
|
||||
</div>
|
||||
|
||||
<!-- ── Plans grid ── -->
|
||||
@@ -2343,6 +2348,15 @@
|
||||
document.getElementById('pricing-period').addEventListener('change', updatePeriodDisplay);
|
||||
updatePeriodDisplay(); // fire on load so yearly bonuses show by default
|
||||
|
||||
/* ── Capture UTM params from URL ──────────────────────────── */
|
||||
(function () {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
['source', 'medium', 'campaign', 'term', 'content'].forEach(function (key) {
|
||||
const val = params.get('utm_' + key);
|
||||
if (val) document.getElementById('utm_' + key).value = val;
|
||||
});
|
||||
})();
|
||||
|
||||
/* ── Hire Agent Webhook ───────────────────────────── */
|
||||
const ORDER_WEBHOOK = "https://n8n.derez.ai/webhook/5318a0d8-d064-42fb-95b7-aa5552cb3fa9";
|
||||
|
||||
@@ -2362,6 +2376,11 @@
|
||||
period: period,
|
||||
location: location,
|
||||
coupon: coupon || null,
|
||||
utm_source: document.getElementById('utm_source').value || null,
|
||||
utm_medium: document.getElementById('utm_medium').value || null,
|
||||
utm_campaign: document.getElementById('utm_campaign').value || null,
|
||||
utm_term: document.getElementById('utm_term').value || null,
|
||||
utm_content: document.getElementById('utm_content').value || null,
|
||||
}),
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user