Skip to content

Commit c04cc56

Browse files
committed
.
1 parent 3773841 commit c04cc56

File tree

9 files changed

+882
-538
lines changed

9 files changed

+882
-538
lines changed

docs/en.html

Lines changed: 71 additions & 236 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 115 additions & 243 deletions
Large diffs are not rendered by default.

docs/privacy-en.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66

7+
<!-- Google tag (gtag.js) -->
8+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-T1PNWJYF69"></script>
9+
<script>
10+
window.dataLayer = window.dataLayer || [];
11+
function gtag(){dataLayer.push(arguments);}
12+
gtag('js', new Date());
13+
14+
gtag('config', 'G-T1PNWJYF69');
15+
</script>
16+
717
<!-- Primary Meta Tags -->
818
<title>Vakit – Privacy Policy</title>
919
<meta name="title" content="Vakit – Privacy Policy">

docs/privacy.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66

7+
<!-- Google tag (gtag.js) -->
8+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-T1PNWJYF69"></script>
9+
<script>
10+
window.dataLayer = window.dataLayer || [];
11+
function gtag(){dataLayer.push(arguments);}
12+
gtag('js', new Date());
13+
14+
gtag('config', 'G-T1PNWJYF69');
15+
</script>
16+
717
<!-- Primary Meta Tags -->
818
<title>Vakit – Gizlilik Politikası</title>
919
<meta name="title" content="Vakit – Gizlilik Politikası">

docs/script.js

Lines changed: 169 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ document.addEventListener('DOMContentLoaded', function() {
66
button.addEventListener('click', function() {
77
const lang = this.getAttribute('data-lang');
88
switchLanguage(lang);
9+
10+
// Analytics event for language switch
11+
if (typeof gtag !== 'undefined') {
12+
gtag('event', 'language_switch', {
13+
'event_category': 'engagement',
14+
'event_label': lang,
15+
'value': 1
16+
});
17+
}
918
});
1019
});
1120

@@ -185,7 +194,7 @@ document.addEventListener('DOMContentLoaded', function() {
185194
});
186195
}
187196

188-
// Button hover effects
197+
// Button hover effects and analytics tracking
189198
const buttons = document.querySelectorAll('.btn');
190199
buttons.forEach(button => {
191200
button.addEventListener('mouseenter', function() {
@@ -195,6 +204,37 @@ document.addEventListener('DOMContentLoaded', function() {
195204
button.addEventListener('mouseleave', function() {
196205
this.style.transform = 'translateY(0) scale(1)';
197206
});
207+
208+
// Analytics tracking for button clicks
209+
button.addEventListener('click', function() {
210+
const buttonText = this.textContent.trim();
211+
const buttonHref = this.getAttribute('href');
212+
213+
if (typeof gtag !== 'undefined') {
214+
if (buttonHref && buttonHref.includes('apps.apple.com')) {
215+
// App Store download tracking
216+
gtag('event', 'app_download_click', {
217+
'event_category': 'conversion',
218+
'event_label': 'app_store',
219+
'value': 1
220+
});
221+
} else if (buttonText.includes('Özellikleri Gör') || buttonText.includes('View Features')) {
222+
// Features button tracking
223+
gtag('event', 'features_view_click', {
224+
'event_category': 'engagement',
225+
'event_label': 'features_button',
226+
'value': 1
227+
});
228+
} else {
229+
// General button click tracking
230+
gtag('event', 'button_click', {
231+
'event_category': 'engagement',
232+
'event_label': buttonText,
233+
'value': 1
234+
});
235+
}
236+
}
237+
});
198238
});
199239

200240
// Feature cards hover effect
@@ -290,14 +330,23 @@ document.addEventListener('DOMContentLoaded', function() {
290330
});
291331
}
292332

293-
// Add loading animation
333+
// Add loading animation and page load tracking
294334
window.addEventListener('load', function() {
295335
document.body.style.opacity = '0';
296336
document.body.style.transition = 'opacity 0.5s ease';
297337

298338
setTimeout(() => {
299339
document.body.style.opacity = '1';
300340
}, 100);
341+
342+
// Analytics tracking for page load
343+
if (typeof gtag !== 'undefined') {
344+
gtag('event', 'page_load', {
345+
'event_category': 'engagement',
346+
'event_label': 'landing_page',
347+
'value': 1
348+
});
349+
}
301350
});
302351

303352
// Add scroll progress indicator
@@ -314,11 +363,29 @@ document.addEventListener('DOMContentLoaded', function() {
314363
`;
315364
document.body.appendChild(progressBar);
316365

366+
// Track scroll depth for analytics
367+
let scrollMilestones = [25, 50, 75, 100];
368+
let scrollMilestonesReached = [];
369+
317370
window.addEventListener('scroll', function() {
318371
const scrollTop = window.pageYOffset;
319372
const docHeight = document.body.offsetHeight - window.innerHeight;
320373
const scrollPercent = (scrollTop / docHeight) * 100;
321374
progressBar.style.width = scrollPercent + '%';
375+
376+
// Analytics tracking for scroll depth
377+
if (typeof gtag !== 'undefined') {
378+
scrollMilestones.forEach(milestone => {
379+
if (scrollPercent >= milestone && !scrollMilestonesReached.includes(milestone)) {
380+
scrollMilestonesReached.push(milestone);
381+
gtag('event', 'scroll_depth', {
382+
'event_category': 'engagement',
383+
'event_label': milestone + '%',
384+
'value': milestone
385+
});
386+
}
387+
});
388+
}
322389
});
323390
});
324391

@@ -453,6 +520,15 @@ function changeSlide(direction) {
453520
// Add active class to new slide and dot
454521
slides[currentSlideIndex].classList.add('active');
455522
dots[currentSlideIndex].classList.add('active');
523+
524+
// Analytics tracking for carousel navigation
525+
if (typeof gtag !== 'undefined') {
526+
gtag('event', 'carousel_navigation', {
527+
'event_category': 'engagement',
528+
'event_label': direction > 0 ? 'next' : 'previous',
529+
'value': currentSlideIndex + 1
530+
});
531+
}
456532
}
457533

458534
function currentSlide(slideNumber) {
@@ -469,6 +545,15 @@ function currentSlide(slideNumber) {
469545
// Add active class to new slide and dot
470546
slides[currentSlideIndex].classList.add('active');
471547
dots[currentSlideIndex].classList.add('active');
548+
549+
// Analytics tracking for dot navigation
550+
if (typeof gtag !== 'undefined') {
551+
gtag('event', 'carousel_dot_click', {
552+
'event_category': 'engagement',
553+
'event_label': 'slide_' + slideNumber,
554+
'value': slideNumber
555+
});
556+
}
472557
}
473558

474559
// Auto-rotate carousel
@@ -498,4 +583,85 @@ document.addEventListener('DOMContentLoaded', function() {
498583
}, 5000);
499584
});
500585
}
501-
});
586+
587+
// Scroll-based screenshot functionality
588+
initScrollScreenshots();
589+
590+
// Set active navigation link based on current page
591+
setActiveNavigationLink();
592+
});
593+
594+
// Set active navigation link based on current page
595+
function setActiveNavigationLink() {
596+
const currentPath = window.location.pathname;
597+
const navLinks = document.querySelectorAll('.nav-links a');
598+
599+
// Remove active class from all links
600+
navLinks.forEach(link => {
601+
link.classList.remove('active');
602+
});
603+
604+
// Set active class based on current page
605+
if (currentPath.includes('privacy')) {
606+
const privacyLink = document.querySelector('a[href*="privacy"]');
607+
if (privacyLink) privacyLink.classList.add('active');
608+
} else if (currentPath.includes('terms')) {
609+
const termsLink = document.querySelector('a[href*="terms"]');
610+
if (termsLink) termsLink.classList.add('active');
611+
} else if (currentPath.includes('en.html')) {
612+
// For English main page, no specific active link
613+
} else {
614+
// For Turkish main page, no specific active link
615+
}
616+
}
617+
618+
// Scroll-based Screenshot Functionality
619+
function initScrollScreenshots() {
620+
const screenshotItems = document.querySelectorAll('.screenshot-item');
621+
const scrollScreenshots = document.querySelectorAll('.scroll-screenshot');
622+
623+
if (screenshotItems.length === 0 || scrollScreenshots.length === 0) {
624+
return; // Exit if elements don't exist
625+
}
626+
627+
// Create intersection observer for screenshot items
628+
const observer = new IntersectionObserver((entries) => {
629+
entries.forEach(entry => {
630+
if (entry.isIntersecting) {
631+
const slideNumber = entry.target.getAttribute('data-slide');
632+
updateActiveScreenshot(slideNumber);
633+
}
634+
});
635+
}, {
636+
threshold: 0.5,
637+
rootMargin: '-20% 0px -20% 0px'
638+
});
639+
640+
// Observe all screenshot items
641+
screenshotItems.forEach(item => {
642+
observer.observe(item);
643+
});
644+
645+
// Set initial active state
646+
screenshotItems[0].classList.add('active');
647+
}
648+
649+
function updateActiveScreenshot(slideNumber) {
650+
// Update screenshot images
651+
const scrollScreenshots = document.querySelectorAll('.scroll-screenshot');
652+
scrollScreenshots.forEach(img => {
653+
img.classList.remove('active');
654+
if (img.getAttribute('data-slide') === slideNumber) {
655+
img.classList.add('active');
656+
}
657+
});
658+
659+
// Update screenshot items
660+
const screenshotItems = document.querySelectorAll('.screenshot-item');
661+
screenshotItems.forEach(item => {
662+
item.classList.remove('active');
663+
if (item.getAttribute('data-slide') === slideNumber) {
664+
item.classList.add('active');
665+
}
666+
});
667+
}

0 commit comments

Comments
 (0)