
How can I add Google Analytics to my web site?I keep hearing from you and others that I really need to be tracking how people use my Web site and that I should be collecting "aggregate traffic statistics" and such. I've heard that Google Analytics is good - and the price, free, is great - but I'm not really clear how to use it and add it to my site. Can you please step me through the process, Dave? Thanks! You have received good advice! Regardless of the level of complexity of your Web site, whether it's a huge blog with thousands of articles - as mine is - or a five page brochureware billboard for your service business, it's critically important and darn useful to be able to know how many people are visiting your site, from where, how, and what they do once they're on the site. As a simple example, let's say that you offer three different services through your company and you have three pages on your little Web site that highlights those, one per page. Which gets more traffic? What can you conclude about the appeal of your business based on that? Which of those converts into the potential customer picking up the phone and calling you or clicking on "contact us" and emailing in a query? Without feedback you're in the dark. With feedback you can continually refine your pages and your business both, growing smart and effective. Google Analytics is a bit tricky to set up too, so I'm not surprised you've a bit of trepidation about doing so. It involves copying and pasting some pretty complicated code. The good news, though, is that you don't need to understand the HTML and JavaScript you cut and paste, you just need to not mess it up! Start by going to Google Analytics and either signing up for a new account or signing in to your Google account. The button you seek is this: ![]() Once you've signed up you'll see an overview page which won't be very exciting since you don't have any collected data as of yet. On the right you'll see this, however: ![]() Click on the "+ Add new profile" link and you'll be able to specify the URL of your site: ![]() Here you can see that I'm actually stepping through the process of adding the analytics code to my film blog, Dave On Film. Confusingly, the system then gives you an error message that there's no data to show: Well, duh, there's no data because we just set up this account. You'd think Google would be a bit smarter about this step of the process! Scroll down a bit on this page and you'll see the following: All you need to do now is basically copy and paste the complicated-looking HTML code that's in the box. Click anywhere in the box, which should select all of the content. Now type Ctrl-C, or Cmd-C or choose File --> Copy (depending on PC or Mac). Open up another browser window or a new tab and get to the source code for your own Web pages. If you have a blog, you're in luck: just open up the appropriate template or templates so you can access the skeletal contents of the site. Move to the bottom of the source page and before any sort of </body> or </html> simply paste the block of code from Google Analytics. Save the new pages, rebuild your blog if appropriate. If you have a site where you're managing the pages manually, then you want to paste the analytics code onto every single page you'd like it to track and analyze for you. If you skip some, it won't know about them and your reporting data could be skewed. Now that you're done adding the code, refresh the page on Google Analytics and instead of getting the earlier error, you should see this: Great. Now it's just a matter of sitting back and relaxing, waiting for some traffic to show up so you'll have analytic data. In the meantime, this is what it'll look like: ![]() Remember that unlike many other services, Google Analytics is not real time, so if you reload a page, don't expect to instantly see that traffic reflected in your reports. Generally I find that analytics is about 12 hours behind. Now your challenge is to drive traffic to your site and to remember to at least occasionally go and look at the Google Analytics data!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
CGI Scripts and Web Site Programming
,
HTML and CSS
(Article 8910)
Tagged: blogging, film blog, google analytics, web site traffic Previous: How do I erase and reformat an Apple Time Capsule? Next: How do I display filename suffixes in Windows Vista? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. I'm glad this came up because I have a couple of follow-up questions (I already have Analytics on my company's 1-year "new" website): Thanks for the tip, Dave. That made it easy. I'll try it out. Posted by: Eric Savage at June 11, 2009 9:59 PMYou can actually change the date range in the URL so that the current day's data is included in some (maybe all) of the analytics reports. Sitemeter is good for instant gratification. Posted by: Kosmo @ The Casual Observer at June 17, 2009 3:10 PMThank you. I'm going to try this. Posted by: Val Reimer at October 23, 2009 10:37 PMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]()
Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Book Links
|