SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2012
    Location
    US
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem With Google Analytics

    I am not really a php guy, so please bear with me....
    I was asked by a friend who does some seo for people to include Google Analytics in a site he was doing and the site is in php. I read that it could be installed in either the header.php or footer.php. I went for the footer because of how they set up the includes files but it apparently isnt working. I checked some resources online and it says that if it's in the header it needs to be before the closing head tag, if in footer then before the closing body tag. When I look at where the include header is, its after the first body tag and inside the first div. They put all the meta info in each page, the header.php only contains some navigation and search bar elements. The footer is included before the last closing div, so that wouldn't pull the GA script in the right spot either. I am assuming this is why no analytics are registering. Does anyone have insight on this? Should I rearrange the includes? the site is 5starinks.com

    indexfooter.pngindexphp.jpg

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,492
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    How about putting the google analytics code directly at the correct spot in the index.php?

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2012
    Location
    US
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could do that but I would need to do that on every php page. Although now the guys telling me that it is tracking.. The issue is the second analytics snippet that's for the ppc goal tracking on the orderconfirmation.php page. So I'll have to check that when I get home.

    Sent from my Nexus 4 using Tapatalk 2


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •