Skip to content

Commit c83680f

Browse files
author
Michał Gryczka
committed
fortigate: added google analytics
1 parent 27dce69 commit c83680f

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

public/fortigate_vpn_alternative.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@
1010
<link rel="preconnect" href="https://fonts.googleapis.com">
1111
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1212
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
13+
14+
<!-- Google Analytics -->
15+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z2X2PB0P4E"></script>
16+
<script>
17+
window.dataLayer = window.dataLayer || [];
18+
function gtag(){dataLayer.push(arguments);}
19+
gtag('js', new Date());
20+
gtag('config', 'G-Z2X2PB0P4E', {
21+
page_title: 'FortiGate VPN Alternative - Defguard',
22+
page_location: window.location.href,
23+
custom_map: {
24+
'custom_parameter_1': 'fortigate_alternative'
25+
},
26+
debug_mode: true
27+
});
28+
29+
// Track page view
30+
gtag('event', 'page_view', {
31+
page_title: 'FortiGate VPN Alternative - Defguard',
32+
page_location: window.location.href,
33+
page_path: '/fortigate_vpn_alternative.html',
34+
content_group1: 'Landing Pages',
35+
content_group2: 'FortiGate Alternative'
36+
});
37+
</script>
38+
1339
<style>
1440
body {
1541
font-family: 'Inter', sans-serif;
@@ -368,6 +394,13 @@ <h2 class="text-3xl md:text-4xl font-bold">Ready to Elevate Your Security?</h2>
368394

369395
const tabId = clickedButton.dataset.tab;
370396

397+
// Track tab interaction
398+
gtag('event', 'tab_click', {
399+
event_category: 'FortiGate Comparison',
400+
event_label: tabId,
401+
value: 1
402+
});
403+
371404
tabButtons.forEach(button => {
372405
button.classList.remove('active-tab');
373406
button.classList.add('text-gray-400', 'hover:text-blue-400', 'hover:border-blue-400');
@@ -385,6 +418,51 @@ <h2 class="text-3xl md:text-4xl font-bold">Ready to Elevate Your Security?</h2>
385418
});
386419
});
387420
}
421+
422+
// Track CTA button clicks
423+
const ctaButtons = document.querySelectorAll('a[href*="book-a-demo"], a[href*="defguard-vs-fortinet"]');
424+
ctaButtons.forEach(button => {
425+
button.addEventListener('click', function(e) {
426+
const buttonText = this.textContent.trim();
427+
const buttonUrl = this.href;
428+
429+
gtag('event', 'cta_click', {
430+
event_category: 'FortiGate Alternative',
431+
event_label: buttonText,
432+
value: 1,
433+
link_url: buttonUrl
434+
});
435+
});
436+
});
437+
438+
// Track navigation clicks
439+
const navLinks = document.querySelectorAll('nav a[href^="#"]');
440+
navLinks.forEach(link => {
441+
link.addEventListener('click', function(e) {
442+
const sectionId = this.getAttribute('href').substring(1);
443+
444+
gtag('event', 'navigation_click', {
445+
event_category: 'FortiGate Alternative',
446+
event_label: sectionId,
447+
value: 1
448+
});
449+
});
450+
});
451+
452+
// Track scroll depth
453+
let maxScroll = 0;
454+
window.addEventListener('scroll', function() {
455+
const scrollPercent = Math.round((window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100);
456+
457+
if (scrollPercent > maxScroll && scrollPercent % 25 === 0) {
458+
maxScroll = scrollPercent;
459+
gtag('event', 'scroll_depth', {
460+
event_category: 'FortiGate Alternative',
461+
event_label: scrollPercent + '%',
462+
value: scrollPercent
463+
});
464+
}
465+
});
388466
});
389467
</script>
390468

0 commit comments

Comments
 (0)