// you’re reading...

Website Development

Add Google Analytics Differently For Sites With Frames

Make sure you look over this documentation page if you decide to use Google Analytics on a site with frames. The traffic sources for one of our niche sites weren’t showing up properly (it listed search engine traffic as referral traffic) and I couldn’t figure out why. It turns out you need to put the Analytics code in the <head> section of the frameset page in addition to the right before the </body> of the frame pages.

One other weird thing (makes sense but weird to see at first) is the way it shows page views. Instead of a single page impression, it records an impression for the frameset page and each of the frame pages. So when someone visits a page with two child frame pages you’ll see three impressions in your reports.

47

Liked this article? Share it:
  • Digg
  • del.icio.us
  • Fark
  • Furl
  • Reddit
  • Spurl
  • Technorati
  • StumbleUpon
  • Bumpzee
  • E-mail this story to a friend!

If you enjoyed this post, make sure you subscribe to my RSS feed!

Discussion

2 comments for “Add Google Analytics Differently For Sites With Frames”

  1. God, I can’t believe there are still people using frames out there! They are so SEO unfriendly!

    Posted by Ryan | April 28, 2008, 5:40 am
  2. @Ryan

    Yes, frames are bad for SEO. That niche site contains a web application and essentially zero content. So there isn’t much for the search engines to do anyway.

    Posted by 47 | April 30, 2008, 1:37 am

Post a comment