In Part 1 of the Quick Start Guide we learned how to setup Google Analytics on your web site. In part 2 we are going to learn how to track links on your site that either download content or take users to a different site. Also we will learn how to configure tracking of site searches, If your site has search capabilities.
Link tracking is a method to track link clicks as a page view within Google Analytics. Please note that you do not want to add additional tracking to navigational links within your site. The basic Google Analytics code included on those pages will track. Link Tracking is used to track links that either take a user to a different site, tracking how many time a file was downloaded, or if your site utilized AJAX to dynamically update elements on the page you could track if a user sees the dynamic content.
How to Track a Link
- The page must include the Google Analytics code in it from Part 1
- Add pageTracker._trackPageview(‘url’); to the onclick function of the link
- To view the link clicks simply access your google analytics account and the link will show up as a page view within the “Content Overview” section.
Site Search is a element that allows the user to input a search query and be provided with results to possible pages that match the query they entered. A basic search would allow the user to input a string and return pages that contain the string or tokens (words) in the string. If your site contains a search feature you can enable Google Analytics to track what your visitors search for, this can give you a better idea of how to organize your content.
How to Enable Site Search
- Login to your google analytics account http://www.google.com/analytics/
- Select the Account that you want to enable site search for.
- Select “Edit” under the actions for the profile you want to enable site search on.
- Select “Edit” on the right of the section called “Main Website Profile Settings”
- Scroll down to the section entitle Site Search
- Select “Do Track Site Search”
- In the Field “Query Parameters” enter the url paramater that the search string is passed to the search page. This can be any string but for example /search/?query=Test Search would be query
- If desired you can select “Yes, strip query parameters out of URL” so that each unique search query does’nt get tracked as its own page
- Click “Save Changes”
- Site Search is now enabled on your site
How to View Site Search
To view what users have searched for on your site you would follow the following steps from the Dashboard screen that is accessed by the “View Report” link on the Account Profiles page.
- Select Content in the left navigation to expand its sub options
- Select “Site Search” from the options within “Content”
From the Site Search Report page you can gather basic information on how many vistors used search, how many searches, and additional information. If you want to see what users are searching for select “Search Terms” in the left navigation within “Site Search”.
Tracking non page links and site searches will help you determine what content on your site visitors find useful. Using this information will help you refine/ or expand your site to increase traffic and user satisfaction. In part 3 of this guide you will get introduced to “Campaign Tracking” which lets you enhance tracking of how users got to your site via advertisements (banner ads, text links).