PHP template site and Google Analytics

Discussion in 'Google Analytics' started by joliett89, Feb 9, 2012.

  1. #1
    I have a single website (I made it myself) with one header, footer and multiple sites in between (I use php include function). I also created a simple command that dynamically changes pages title depening on the site that is used; thats from the header.php

    <meta charset="utf-8" />
    <title><?php if (isset($subtitle)) { echo $subtitle; } ?></title>
    <link rel="stylesheet" href="css/main.css" type="text/css" />
    </head>

    I just signed up for Google Analytics and I know that I need to add the code they provide just before the </head> tag and I am wondering how is it gonna affect tracking all the pages that I have:

    Home
    Services
    Resources
    Blog
    Contact

    I am gonna be embeding Wordpress into the site, but I am not gonna worry about tracking all the pages there etc, but I would like to have separate data for all the listed above subpages. What is the way to do that? Is it gonna work if I am just gonna add the code to single header.php file now?

    Thank you.
     
    joliett89, Feb 9, 2012 IP
  2. siketich91

    siketich91 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you add analytic code in head then don't worry about you track all pages.
     
    siketich91, Feb 16, 2012 IP
  3. sanchez

    sanchez Active Member

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    As long as different subpages = different URL, you're all set :)
     
    sanchez, Feb 17, 2012 IP