-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcustom.html
More file actions
56 lines (50 loc) · 1.84 KB
/
custom.html
File metadata and controls
56 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/23414950.js"></script>
<!-- End of HubSpot Embed Code -->
<!-- Consent-aware tracking integrations using HubSpot's official API -->
<script>
(function () {
if (typeof window === "undefined") return;
// Initialize HubSpot privacy consent array
window._hsp = window._hsp || [];
// Loader for Reo tracking script (respects consent)
function loadReo() {
if (window.__reoLoaded) return; // idempotent
window.__reoLoaded = true;
var clientID = 'a302bd2a30723ff';
var s = document.createElement('script');
s.src = 'https://static.reo.dev/' + clientID + '/reo.js';
s.defer = true;
s.onload = function () {
try {
if (window.Reo && typeof window.Reo.init === 'function') {
window.Reo.init({ clientID: clientID });
}
} catch (_) {}
};
document.head.appendChild(s);
}
// Loader for Google Tag Manager (respects consent)
function loadGTM() {
if (window.__gtmLoaded) return;
window.__gtmLoaded = true;
var gtmId = 'GTM-T8Z9D5XH';
// Initialize dataLayer lazily
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ 'event': 'consent_ready' });
var s = document.createElement('script');
s.defer = true;
s.src = 'https://www.googletagmanager.com/gtm.js?id=' + encodeURIComponent(gtmId);
document.head.appendChild(s);
}
// Use HubSpot's official privacy consent listener
window._hsp.push(['addPrivacyConsentListener', function(consent) {
// Check if analytics consent is granted
if (consent && consent.categories && consent.categories.analytics) {
loadReo();
loadGTM();
loadGA();
}
}]);
})();
</script>