<?php
// Enhanced security headers
// Session for CSRF token
ini_set('session.cookie_samesite', 'Lax');
ini_set('session.cookie_httponly', '1');
ini_set('session.cookie_secure', '1');
session_start();

// Prevent caching - page contains session-specific tokens
// Aggressive no-cache headers removed to improve SEO performance. Caching is now enabled.
if (!isset($_SESSION['csrf_token'])) {
    $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
header('Content-Security-Policy: default-src \'self\'; script-src \'self\' \'unsafe-inline\' https://cdnjs.cloudflare.com https://www.googletagmanager.com https://www.google-analytics.com https://www.clarity.ms https://www.google.com https://www.gstatic.com; style-src \'self\' \'unsafe-inline\' https://fonts.googleapis.com; font-src \'self\' https://fonts.gstatic.com; img-src \'self\' data: https://www.google-analytics.com; connect-src \'self\' https://www.google-analytics.com https://analytics.google.com https://region1.google-analytics.com https://www.google.com; frame-src https://www.google.com;');

// SEO and performance optimizations
$page_title = "Data Analytics Services UK | Insights from Your Data";
$page_description = "Turn raw data into strategic insights. Our UK-based data analytics services help you understand trends, customers, and competitors. Unlock your data's potential.";
$canonical_url = "https://ukdataservices.co.uk/data-analytics-services.php";
$keywords = "data analytics services, business intelligence uk, data visualisation, market trend analysis, customer segmentation, data insights, power bi services, tableau services uk";
$author = "UK Data Services";
$og_image = "https://ukdataservices.co.uk/assets/images/ukds-main-logo.png";
$twitter_card_image = "https://ukdataservices.co.uk/assets/images/ukds-main-logo.png";
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo htmlspecialchars($page_title); ?></title>
    <meta name="description" content="<?php echo htmlspecialchars($page_description); ?>" />
    <meta name="keywords" content="<?php echo htmlspecialchars($keywords); ?>">
    <meta name="author" content="<?php echo htmlspecialchars($author); ?>">
    <meta name="google-site-verification" content="la6e0_PDdHFkUn8NbHI-cMofozMcxtgrf73zwqKz6Ec" />
    <meta name="robots" content="index, follow">
    <meta name="googlebot" content="index, follow">
    <meta name="bingbot" content="index, follow">
    <link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">
    
    <!-- Open Graph / Social Media -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="<?php echo htmlspecialchars($canonical_url); ?>">
    <meta property="og:title" content="<?php echo htmlspecialchars($page_title); ?>">
    <meta property="og:description" content="<?php echo htmlspecialchars($page_description); ?>">
    <meta property="og:image" content="<?php echo htmlspecialchars($og_image); ?>">
    
    <!-- Twitter Card -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:url" content="<?php echo htmlspecialchars($canonical_url); ?>">
    <meta name="twitter:title" content="<?php echo htmlspecialchars($page_title); ?>">
    <meta name="twitter:description" content="<?php echo htmlspecialchars($page_description); ?>">
    <meta name="twitter:image" content="<?php echo htmlspecialchars($twitter_card_image); ?>">
    
    <!-- Favicon and App Icons -->
    <link rel="icon" type="image/svg+xml" href="/assets/images/favicon.svg">
    <link rel="icon" type="image/svg+xml" sizes="16x16" href="/assets/images/favicon-16x16.svg">
    <link rel="icon" type="image/svg+xml" sizes="32x32" href="/assets/images/favicon-32x32.svg">
    <link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon.svg">
    <link rel="manifest" href="/manifest.json">
    <meta name="theme-color" content="#144784">
    <meta name="msapplication-TileColor" content="#179e83">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-mobile-web-app-title" content="UK Data Services">
    
    <!-- Google Analytics 4 (GA4) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-GK41JM8DK0"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-GK41JM8DK0', {
            page_title: document.title,
            page_location: window.location.href
        });
    </script>
    
    <!-- Google Tag Manager (Optional - if you use GTM) -->
    <!-- TODO: Replace GTM-XXXXXXX with your Google Tag Manager container ID -->
    <!-- 
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
    -->
    
    <!-- Microsoft Clarity (Optional) -->
    <!-- TODO: Replace CLARITY_PROJECT_ID with your Clarity project ID -->
    <!--
    <script type="text/javascript">
        (function(c,l,a,r,i,t,y){
            c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
            t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
            y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
        })(window, document, "clarity",
    -->
</head>
<body>
    <?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/nav.php'); ?>

    <main>
        <section class="hero">
            <h1>Data Analytics Services</h1>
            <p class="subtitle">Transform your raw data into actionable business intelligence. Our UK-based analysts help you discover opportunities and make smarter decisions.</p>
            <a href="/contact" class="cta-button">Discuss Your Project</a>
        </section>

        <section class="content-block">
            <h2>From Data Collection to Data-Driven Decisions</h2>
            <p>Having data is one thing; using it effectively is another. Whether you have existing datasets or need data collected via our <a href="/">web scraping services</a>, we can help you unlock its value. Our data analytics services bridge the gap between raw information and strategic insight.</p>
            
            <h3>Our Analytics Process</h3>
            <ol>
                <li><strong>Data Consolidation & Cleaning:</strong> We merge data from various sources and apply rigorous cleaning processes to ensure its integrity and accuracy.</li>
                <li><strong>Exploratory Data Analysis (EDA):</strong> Our analysts dive into your data to identify initial patterns, anomalies, and potential areas for deeper investigation.</li>
                <li><strong>Modelling & Visualisation:</strong> We use statistical models and tools like Power BI or Tableau to create intuitive dashboards and visualisations that make complex data easy to understand.</li>
                <li><strong>Insight & Reporting:</strong> We deliver a comprehensive report detailing key findings, trends, and actionable recommendations tailored to your business goals.</li>
            </ol>
        </section>

        <section class="services">
            <h2>Our Analytics Capabilities</h2>
            <div class="service-cards">
                <div class="card">
                    <h3>Business Intelligence Dashboards</h3>
                    <p>Get a real-time, interactive view of your KPIs. We build custom dashboards that track performance, sales, operations, and more.</p>
                </div>
                <div class="card">
                    <h3>Competitor Analysis</h3>
                    <p>Analyse scraped competitor data to understand their pricing strategies, product assortment, and market positioning.</p>
                </div>
                <div class="card">
                    <h3>Customer Segmentation</h3>
                    <p>Analyse customer data to identify distinct groups. Tailor your marketing and product development for maximum impact.</p>
                </div>
                <div class="card">
                    <h3>Market Trend Analysis</h3>
                    <p>Use historical and real-time data to spot emerging market trends, predict demand, and stay ahead of the curve.</p>
                </div>
            </div>
        </section>

    </main>

    <?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'); ?>
    <link rel="stylesheet" href="/assets/css/main.min.css?v=1.1.4">
    <script src="/assets/js/main.min.js?v=1.1.1"></script>
</body>
</html>