Skip to content

Commit 9312df1

Browse files
author
ghost
committed
added signal event for book call analytics with consent
1 parent baf0f0b commit 9312df1

8 files changed

Lines changed: 86 additions & 12 deletions

90-days-roadmap.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
<link rel="shortcut icon" href="favicon.ico">
247247
<link rel="manifest" href="site.webmanifest">
248248

249+
<script src="book-call.js" defer></script>
249250
</head>
250251

251252
<body>
@@ -379,7 +380,7 @@ <h2 class="timeline-title">End‑to‑End Security Review</h2>
379380
<!-- Call to action (same style as your example) -->
380381
<div class="cta">
381382
<p><strong>Want to apply this roadmap to YOUR environment?</strong></p>
382-
<a href="https://tally.so/r/7R2PPZ">
383+
<a class="book-call" href="https://tally.so/r/7R2PPZ" target="_blank">
383384
<h3>Click here 👉 to submit your contact details via form to book a quick meeting!</h3>
384385
</a>
385386
</div>

ai-security-assessment.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
<link rel="shortcut icon" href="favicon.ico">
211211
<link rel="manifest" href="site.webmanifest">
212212

213+
<script src="book-call.js" defer></script>
213214
</head>
214215

215216
<body>
@@ -290,7 +291,7 @@ <h3>Your 3 Priority Fixes:</h3>
290291
</div>
291292
<div class="cta">
292293
<p><strong>Want personalized fixes for YOUR environment?</strong></p>
293-
<a href="https://tally.so/r/7R2PPZ">
294+
<a class="book-call" href="https://tally.so/r/7R2PPZ" target="_blank">
294295
<h3>Click here 👉 to submit your contact details via form to book a quick meeting!</h3>
295296
</a>
296297
</div>

book-call.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// book-call.js
2+
(function () {
3+
const CONSENT_KEY = 'mousaConsentV1';
4+
const EVENT_NAME = 'clicked_contact_button_link';
5+
const SELECTOR = '.book-call';
6+
7+
function hasConsent() {
8+
try {
9+
const raw = localStorage.getItem(CONSENT_KEY);
10+
if (!raw) return false;
11+
const c = JSON.parse(raw);
12+
return c && c.accepted === true;
13+
} catch (e) {
14+
return false;
15+
}
16+
}
17+
18+
function fireEventIfAllowed() {
19+
if (hasConsent() && typeof window.gtag === 'function') {
20+
try {
21+
window.gtag('event', EVENT_NAME, { transport_type: 'beacon' });
22+
//console.log('book call event fired');
23+
} catch (e) {
24+
console.warn('gtag error', e);
25+
}
26+
}
27+
}
28+
29+
function attachListeners() {
30+
const els = document.querySelectorAll(SELECTOR);
31+
if (!els || els.length === 0) return;
32+
els.forEach(function (el) {
33+
// avoid attaching twice
34+
if (el.__bookCallAttached) return;
35+
el.__bookCallAttached = true;
36+
el.addEventListener('click', function () {
37+
fireEventIfAllowed();
38+
});
39+
});
40+
}
41+
42+
// Attach now and also after DOMContentLoaded if needed
43+
if (document.readyState === 'loading') {
44+
document.addEventListener('DOMContentLoaded', attachListeners);
45+
} else {
46+
attachListeners();
47+
}
48+
49+
// Also re-run if elements are added dynamically (mutation observer)
50+
try {
51+
const mo = new MutationObserver(function () {
52+
attachListeners();
53+
});
54+
mo.observe(document.documentElement || document.body, { childList: true, subtree: true });
55+
} catch (e) {
56+
// MutationObserver not available — fine to skip
57+
}
58+
59+
// Optional: expose for manual re-attach
60+
window.__bookCall = {
61+
attach: attachListeners,
62+
hasConsent: hasConsent
63+
};
64+
})();

cloud-quick-assessment.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
<link rel="shortcut icon" href="favicon.ico">
211211
<link rel="manifest" href="site.webmanifest">
212212

213+
<script src="book-call.js" defer></script>
213214
</head>
214215

215216
<body>
@@ -304,7 +305,7 @@ <h3>Your 3 Priority Fixes:</h3>
304305
</div>
305306
<div class="cta">
306307
<p><strong>Want personalized fixes for YOUR environment?</strong></p>
307-
<a href="https://tally.so/r/7R2PPZ">
308+
<a class="book-call" href="https://tally.so/r/7R2PPZ" target="_blank">
308309
<h3>Click here 👉 to submit your contact details via form to book a quick meeting!</h3>
309310
</a>
310311
</div>

compliance-readiness-assessment.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@
210210
<link rel="shortcut icon" href="favicon.ico">
211211
<link rel="manifest" href="site.webmanifest">
212212

213+
<script src="book-call.js" defer></script>
214+
213215
</head>
214216

215217
<body>
@@ -321,7 +323,7 @@ <h3>Your Priority Actions:</h3>
321323
</div>
322324
<div class="cta">
323325
<p><strong>Need help closing these gaps before your audit?</strong></p>
324-
<a href="https://tally.so/r/7R2PPZ">
326+
<a class="book-call" href="https://tally.so/r/7R2PPZ" target="_blank">
325327
<h3>Book a 30-minute compliance assessment call →</h3>
326328
</a>
327329
</div>

footer.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
}
1313
</style>
1414

15+
<script src="book-call.js" defer></script>
16+
1517
<footer class="site-footer" style="background: #1a1a1a; color: #fff; padding: 40px 20px 20px; font-size: 14px;">
1618
<div class="container"
1719
style="max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px;">
@@ -49,7 +51,7 @@ <h4>Legal</h4>
4951

5052
<!-- Bottom Bar: CTA + Copyright + Social -->
5153
<div style="border-top: 1px solid #333; padding-top: 20px; text-align: center; margin-top: 20px;">
52-
<a href="https://tally.so/r/7R2PPZ"
54+
<a class="book-call" href="https://tally.so/r/7R2PPZ"
5355
style="background: #007bff; color: white; padding: 10px 20px; border-radius: 5px; text-decoration: none; margin-right: 20px;"
5456
target="_blank">Book
5557
Discovery Call</a>

index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@
468468
}
469469
</style>
470470

471+
<script src="book-call.js" defer></script>
472+
471473
</head>
472474

473475
<body>
@@ -522,7 +524,7 @@ <h2><em><a href="ethics.html" target="_blank">Upholding Ethics and Integrity in
522524
<p class="hero-trust-line">
523525
UK-based, serving US companies remotely with EST-friendly scheduling and USD pricing.
524526
</p>
525-
<b><a href="#tally-form">👉 Book Free Discovery Call</a></b>
527+
<b><a class="book-call" href="#tally-form" target="_blank">👉 Book Free Discovery Call</a></b>
526528
<hr>
527529
<details class="scenario-box">
528530
<summary class="scenario-title" style="
@@ -760,8 +762,8 @@ <h3 style="color: #dc3545; margin: 0 0 12px 0; font-size: 20px;">API Key Risk Re
760762
</div>
761763

762764
<div style="text-align: center; margin-top: 30px;">
763-
<a href="#tally-form"
764-
style="background: linear-gradient(135deg, #007BFF, #0056b3); color: white; padding: 15px 40px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 18px; box-shadow: 0 6px 20px rgba(0,123,255,0.3); display: inline-block; transition: all 0.3s;">
765+
<a class="book-call" href="#tally-form"
766+
style="background: linear-gradient(135deg, #007BFF, #0056b3); color: white; padding: 15px 40px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 18px; box-shadow: 0 6px 20px rgba(0,123,255,0.3); display: inline-block; transition: all 0.3s;" target="_blank">
765767
Book Free Discovery Call → See Your Risk Reduction Path
766768
</a>
767769
</div>
@@ -939,8 +941,8 @@ <h3 style="color: #b8860b; margin: 0 0 0.75rem 0; font-size: 1.25rem;">Complianc
939941
</div>
940942

941943
<p style="margin-top:1rem;">
942-
<a href="#tally-form"
943-
style="background:#007BFF; color:white; padding:12px 24px; border-radius:30px; text-decoration:none; font-weight:600; display:inline-block;">
944+
<a class="book-call" href="#tally-form"
945+
style="background:#007BFF; color:white; padding:12px 24px; border-radius:30px; text-decoration:none; font-weight:600; display:inline-block;" target="_blank">
944946
Book a free 30-minute discovery call
945947
</a>
946948
</p>
@@ -1051,7 +1053,7 @@ <h3 style="color: #053a10; margin: 0 0 0.75rem 0; font-size: 1.25rem;">48-Hour G
10511053
</div>
10521054

10531055
<p style="margin-top:1rem;">
1054-
<a href="#tally-form"
1056+
<a class="book-call" href="#tally-form"
10551057
style="background:#007BFF; color:white; padding:12px 24px; border-radius:30px; text-decoration:none; font-weight:600; display:inline-block;">
10561058
Book a free 30-minute discovery call
10571059
</a>

quantum-readiness.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
}
201201
</style>
202202

203+
<script src="book-call.js" defer></script>
203204
</head>
204205

205206
<body>
@@ -253,7 +254,7 @@ <h3>Fix This First</h3>
253254

254255
<div id="ctaSection" class="cta">
255256
<p><strong>Quantum security emergency?</strong></p>
256-
<a href="https://tally.so/r/7R2PPZ">Book 30-min quantum assessment call</a>
257+
<a class="book-call" href="https://tally.so/r/7R2PPZ" target="_blank">Book 30-min quantum assessment call</a>
257258
</div>
258259

259260
<script>

0 commit comments

Comments
 (0)