<?php
/**
 * UK Data Services - Meta Tags Template
 * Version: 1.0
 * Last Updated: December 7, 2025
 *
 * This file provides a standardized template for meta tag implementation
 * across all UK Data Services web pages.
 *
 * USAGE:
 * Copy the appropriate section to each page's <head> tag
 * Replace variables with page-specific content
 * Ensure character limits are respected:
 *   - Title: 50-60 characters
 *   - Description: 150-160 characters
 */

// ===========================================================================
// HOMEPAGE / MAIN PAGES TEMPLATE
// ===========================================================================
?>

<?php
// Homepage Meta Variables
$page_title = "Professional Web Scraping & Data Analytics UK"; // 54 chars - OPTIMAL
$page_description = "Expert data extraction services trusted by 150+ UK businesses. Get competitive pricing & 99.8% accuracy with GDPR compliance. Free quote available."; // 155 chars
$canonical_url = "https://ukdataservices.co.uk/";
$og_image = "https://ukdataservices.co.uk/assets/images/homepage-hero.jpg"; // 1200x630px
$keywords = "web scraping services UK, data analytics London, data extraction";
$author = "UK Data Services";
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Core Meta Tags -->
    <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="robots" content="index, follow">
    <link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">

    <!-- Favicon -->
    <link rel="icon" type="image/svg+xml" href="/assets/images/favicon.svg">
    <link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon.svg">

    <!-- Open Graph Tags (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); ?>">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:locale" content="en_GB">

    <!-- Twitter Card Tags -->
    <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($og_image); ?>">
    <meta name="twitter:creator" content="@ukdataservices">
    <meta name="twitter:site" content="@ukdataservices">

    <!-- More Content Here -->
</head>

<?php
// ===========================================================================
// SERVICE PAGE TEMPLATE
// ===========================================================================
?>

<?php
// Service Page Meta Variables
$page_title = "Data Cleaning & Validation Services UK"; // 54 chars
$page_description = "Professional data cleaning with 99.8% accuracy. Remove duplicates, standardize formats, ensure compliance. 24-hour turnaround. Get your free audit today."; // 160 chars
$canonical_url = "https://ukdataservices.co.uk/services/data-cleaning";
$og_image = "https://ukdataservices.co.uk/assets/images/data-cleaning-service.jpg";
$keywords = "data cleaning UK, data validation, duplicate removal, data quality";
?>

<!-- For Service Pages -->
<meta name="description" content="<?php echo htmlspecialchars($page_description); ?>">
<meta property="og:type" content="website"> <!-- or "service" if supported -->
<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); ?>">
<meta property="og:locale" content="en_GB">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<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($og_image); ?>">
<meta name="twitter:creator" content="@ukdataservices">
<meta name="twitter:site" content="@ukdataservices">

<?php
// ===========================================================================
// BLOG ARTICLE TEMPLATE
// ===========================================================================
?>

<?php
// Blog Article Meta Variables
$article_title = "Web Scraping Services UK 2025 - Buyer's Complete Guide"; // 57 chars - OPTIMAL
$article_description = "Compare UK web scraping services by price, features & compliance. Find the right provider for data extraction, pricing models, support levels & ROI."; // 158 chars
$canonical_url = "https://ukdataservices.co.uk/blog/articles/web-scraping-services-uk-complete-buyers-guide";
$og_image = "https://ukdataservices.co.uk/assets/images/blog/web-scraping-guide.jpg";
$article_author = "UK Data Services Editorial Team";
$published_date = "2025-08-08";
$modified_date = "2025-08-08";
$article_slug = "web-scraping-services-uk-complete-buyers-guide";
$article_category = "Web Scraping";
$article_tags = ["Web Scraping", "UK Services", "Data Extraction", "Buyer's Guide", "Comparison"];
?>

<!-- Blog Article Meta Tags -->
<title><?php echo htmlspecialchars($article_title); ?> | UK Data Services Blog</title>
<meta name="description" content="<?php echo htmlspecialchars($article_description); ?>">
<meta name="author" content="<?php echo htmlspecialchars($article_author); ?>">
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">

<!-- Open Graph Article Tags -->
<meta property="og:type" content="article">
<meta property="og:url" content="<?php echo htmlspecialchars($canonical_url); ?>">
<meta property="og:title" content="<?php echo htmlspecialchars($article_title); ?>">
<meta property="og:description" content="<?php echo htmlspecialchars($article_description); ?>">
<meta property="og:image" content="<?php echo htmlspecialchars($og_image); ?>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:locale" content="en_GB">
<meta property="article:published_time" content="<?php echo $published_date; ?>T09:00:00+00:00">
<meta property="article:modified_time" content="<?php echo $modified_date; ?>T09:00:00+00:00">
<meta property="article:section" content="<?php echo htmlspecialchars($article_category); ?>">
<?php foreach ($article_tags as $tag): ?>
<meta property="article:tag" content="<?php echo htmlspecialchars($tag); ?>">
<?php endforeach; ?>

<!-- Twitter Card Article Tags -->
<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($article_title); ?>">
<meta name="twitter:description" content="<?php echo htmlspecialchars($article_description); ?>">
<meta name="twitter:image" content="<?php echo htmlspecialchars($og_image); ?>">
<meta name="twitter:creator" content="@author_handle"> <!-- Use actual author Twitter handle -->
<meta name="twitter:site" content="@ukdataservices">

<?php
// ===========================================================================
// LEGAL PAGE TEMPLATE (Privacy, Terms, Cookies)
// ===========================================================================
?>

<?php
// Legal Page Meta Variables
$page_title = "Privacy Policy - GDPR Compliant Data Protection"; // 50 chars
$page_description = "Our commitment to your data security. GDPR compliant, transparent practices, your privacy protected. Detailed policy available here."; // 140 chars (SHORT - acceptable for legal)
$canonical_url = "https://ukdataservices.co.uk/privacy-policy";
$og_image = "https://ukdataservices.co.uk/assets/images/privacy-hero.jpg";
?>

<!-- Legal Page Meta Tags -->
<title><?php echo htmlspecialchars($page_title); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($page_description); ?>">
<meta name="robots" content="index, follow">
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">

<!-- Open Graph -->
<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); ?>">
<meta property="og:locale" content="en_GB">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="<?php echo htmlspecialchars($page_title); ?>">
<meta name="twitter:description" content="<?php echo htmlspecialchars($page_description); ?>">
<meta name="twitter:site" content="@ukdataservices">

<?php
// ===========================================================================
// CASE STUDIES / COLLECTION PAGE TEMPLATE
// ===========================================================================
?>

<?php
// Collection Page Meta Variables
$page_title = "Case Studies: Data Solutions Success Stories UK"; // 49 chars
$page_description = "Real client wins: 500K revenue increase, 50M records migrated, 99.99% accuracy. See how UK Data Services delivered measurable ROI."; // 138 chars
$canonical_url = "https://ukdataservices.co.uk/case-studies/";
$og_image = "https://ukdataservices.co.uk/assets/images/case-studies-hero.jpg";
?>

<!-- Collection Page Meta Tags -->
<title><?php echo htmlspecialchars($page_title); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($page_description); ?>">
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">

<!-- Open Graph -->
<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); ?>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:locale" content="en_GB">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<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($og_image); ?>">
<meta name="twitter:site" content="@ukdataservices">

<?php
// ===========================================================================
// CTA/LEAD GENERATION PAGE TEMPLATE (Quote, Contact)
// ===========================================================================
?>

<?php
// CTA Page Meta Variables
$page_title = "Free Data Project Quote in 24 Hours - UK Data Services"; // 57 chars
$page_description = "No-obligation data project quote within 24 hours. Expert analysis, transparent pricing, zero hidden fees. Get started now - initial consultation free."; // 160 chars (PERFECT)
$canonical_url = "https://ukdataservices.co.uk/quote";
$og_image = "https://ukdataservices.co.uk/assets/images/quote-cta.jpg";
?>

<!-- CTA Page Meta Tags -->
<title><?php echo htmlspecialchars($page_title); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($page_description); ?>">
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">

<!-- Open Graph -->
<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); ?>">
<meta property="og:locale" content="en_GB">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<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($og_image); ?>">
<meta name="twitter:site" content="@ukdataservices">

<?php
// ===========================================================================
// CHARACTER REFERENCE GUIDE
// ===========================================================================
/**
 * OPTIMAL CHARACTER COUNTS:
 *
 * TITLE TAG:
 * - Desktop SERP: 50-60 characters
 * - Mobile SERP: 35-45 characters
 * - Recommendation: 50-60 (accommodates both)
 *
 * META DESCRIPTION:
 * - Desktop SERP: 150-160 characters
 * - Mobile SERP: 100-130 characters
 * - Recommendation: 150-160 (provides context, mobile shows ~120)
 *
 * URL SLUG:
 * - Recommended: 30-60 characters
 * - Use hyphens, lowercase only
 * - Include primary keyword
 *
 * SOCIAL SHARING (OG Image):
 * - Recommended size: 1200 x 630 pixels
 * - Aspect ratio: 1.91:1
 * - Format: JPG or PNG
 * - Max file size: 300KB
 *
 * CHARACTER COUNTING:
 * Use https://www.charactercountyonline.com/
 * Tool correctly counts spaces and special characters
 */

// ===========================================================================
// POWER WORD LIBRARY
// ===========================================================================
/**
 * HIGH-PERFORMING POWER WORDS BY CONTEXT:
 *
 * Trust/Credibility:
 * - Trusted, Certified, Award-Winning, Industry-Leading, Proven, Verified
 *
 * Urgency:
 * - Fast, Quick, Immediate, 24-Hour, Same-Day, Limited-Time
 *
 * Value/Benefit:
 * - Save, Increase, Revenue, ROI, Measurable, Proven Results
 *
 * Action:
 * - Discover, Unlock, Start, Get, Join, Request, Claim
 *
 * Numbers (High Engagement):
 * - 99.8%, 150+, 500+, 24-Hour, 7-Year
 */

// ===========================================================================
// CTA FORMULA PATTERNS
// ===========================================================================
/**
 * DESCRIPTION CTA PATTERNS:
 *
 * Service Pages:
 * "[Benefit]. [Metric]. [Social Proof]. [CTA action] now."
 * Example: "Professional data cleaning. 99.8% accuracy. 150+ clients. Get free audit now."
 *
 * Blog Pages:
 * "[Topic]. [Key insight]. [Secondary benefit]. [Subscribe/Learn]."
 * Example: "Expert web scraping tips. Save 30% on data costs. Industry trends included. Subscribe."
 *
 * CTA Pages:
 * "[Primary benefit]. [Timeline/Offer]. [Value/Guarantee]. [Action] today."
 * Example: "Free quote in 24 hours. Transparent pricing. Zero hidden fees. Get started today."
 *
 * Legal Pages (Low CTA):
 * "[Topic]. [Assurance]. [Key point]. See full policy."
 * Example: "GDPR compliant practices. Your data protected. Transparent policies. Learn more."
 */

?>

<!-- =====================================================================
   SCHEMA MARKUP RECOMMENDATIONS
   ===================================================================== -->

<?php
// Homepage Organization Schema
$org_schema = [
    "@context" => "https://schema.org",
    "@type" => "Organization",
    "@id" => "https://ukdataservices.co.uk#organization",
    "name" => "UK Data Services",
    "url" => "https://ukdataservices.co.uk",
    "logo" => "https://ukdataservices.co.uk/assets/images/ukds-main-logo.png",
    "description" => "Professional web scraping and data analytics services",
    "sameAs" => [
        "https://twitter.com/ukdataservices",
        "https://www.linkedin.com/company/uk-data-services",
        "https://www.facebook.com/ukdataservices"
    ]
];
?>

<script type="application/ld+json">
<?php echo json_encode($org_schema, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); ?>
</script>

<!-- =====================================================================
   QUALITY CHECKLIST
   ===================================================================== -->

<?php
/**
 * BEFORE PUBLISHING - QUALITY CHECKLIST:
 *
 * [ ] Title is 50-60 characters (use character counter tool)
 * [ ] Description is 150-160 characters (use character counter tool)
 * [ ] Title includes primary keyword in first 30 characters
 * [ ] Description includes power word(s)
 * [ ] Description includes CTA action verb
 * [ ] og:image is 1200x630px JPG/PNG format
 * [ ] og:url matches canonical URL exactly
 * [ ] og:locale is set to en_GB
 * [ ] twitter:card is set to summary_large_image (except legal pages)
 * [ ] twitter:creator is author/company handle
 * [ ] twitter:site is @ukdataservices
 * [ ] Canonical URL is HTTPS, no UTM parameters
 * [ ] No duplicate titles across pages
 * [ ] Keyword stuffing avoided in title/description
 * [ ] Special characters properly encoded (htmlspecialchars)
 * [ ] Mobile preview tested
 * [ ] Social media preview tested (LinkedIn, Twitter, Facebook)
 * [ ] Search preview tested in GSC
 * [ ] Schema markup validates in Rich Results Test
 */
?>

<!-- =====================================================================
   FILE VERSION & CHANGELOG
   ===================================================================== -->

<?php
/**
 * VERSION HISTORY:
 *
 * v1.0 - December 7, 2025
 * - Initial template creation
 * - Includes 5 main page types
 * - CTA formula patterns
 * - Character reference guide
 * - Quality checklist
 *
 * IMPLEMENTATION NOTES:
 * 1. This is a REFERENCE template - copy sections to your actual pages
 * 2. Replace ALL variables with page-specific content
 * 3. Always use htmlspecialchars() for dynamic content
 * 4. Test each page after implementation
 * 5. Monitor Google Search Console for improvements
 *
 * SUPPORT:
 * Reference the full report: META_TAG_OPTIMIZATION_REPORT.md
 * Quick fixes guide: META_TAG_QUICK_FIX_GUIDE.md
 */
?>
