Google Analytics
Viewing Reports
Requesting Access
You will need a Google account, which will be associated with an email address of your choosing. Once you have a Google account, email your account information to webservices@ag.psu.edu and request access to Google Analytics.
Viewing Reports
- Visit: http://google.com/analytics
- Click the "Access Analytics" blue button.
- Log in with your Google.com account
- Under the "Penn State College of Agricultural Sciences" header, expand the "http://agsci.psu.edu" profile using the "+"
- You will have the choice of 2 reports, choose one:
- External traffic only - Displays only non-PSU Web visitors - remove faculty/staff/student traffic. This is usually more important since faculty and staff sometimes skew Web statistics and give you a false sense of traffic patterns.
- Internal and External traffic - Display all traffic regardless if it is internal.
- You are now viewing the dashboard for the entire College - all traffic regardless of website URL. This is not your Web traffic, but instead the entire College.
- To view traffic for a specific website, click "Content" on the left navigation.
- Click "Site Content"
- Click "Pages" to show traffic by the individual page, or "Content Drilldown" to show traffic by the section of the site. These reports present the same data in two different ways.
- You will now see the listing of the top website URLs in the College.
- To view traffic for a specific site, click the URL or use the "filter page" search box at the bottom of the list. If you are filtering down to a specific you only have to type in a portion of the URL. Example, type in "ento" into the filter box and click go, then click the URL.
- You are now viewing traffic specific to a URL.
- You have the following options to view your data:
- You can change the date ranges by clicking the dates on the top right of the screen.
- There are different "views" of the data including table, percentage, performance, and comparisons.
- You can change the "dimension" drop down window to view different types of data including: keyword, location, refer, network location, browser and more.
Note: When "drilling down" into your site's content, please verify you are looking at the correct URL. If you wanted to see reports for: http://ento.psu.edu/extension/factsheets/black-carpet-beetle, you would click ento.psu.edu > extension > factsheets > black-carpet-beetle.
Creating Custom Reports (Segments)
If you are only interested in statistics for an exact website, following the steps above to drill-down to your site becomes a time consuming process. You can follow the steps below to create a custom report that is already focused on one or more URLs. In Google Analytics, you can create an "advanced segment" to narrow down a report to basically any criteria.
- Log into Google Analytics
- Click "Advanced Segments" at the top left of the page (under the orange bar).
- Click "+ New Custom Segment" on the right of the screen (under the "Custom Segments" list).
- Add a "Name" for your segment. For example, you could call it "Entomology site traffic".
- Expand the green dropdown box next to "Include"
- In the search box that shows up, type in "page" as one word.
- Click on the Page item that appears.
- Change the condition to "Begins with" in the drop down box.
- If you would like to filter on an entire site, type the top level URL into the value box (e.g. 'ento.psu.edu'). If you want to filter on a section of the site (e.g. 'ento.psu.edu/extension/factsheets'), put the section URL in the value box. Do not include "http://" or "www." in these URLs.
- Click the "Test Segment" button below the criteria selection. You should see a notice that says, "Out of a total of X visits, this segment matches Y visits". If the number of matching visits is zero or much smaller than you expect, you may want to verify your filtering criteria.
- Click the button "Save Segment" to save and apply your custom segment.
You have now created a new segment, which will be available at any point in the future from only your account. This segment can be applied to your reports by following the instructions below.
Creating a Custom Segment For Multiple URLs
If the URL of your site has changed in the time period that you're reporting on, you will need to include both the old and new URLs in the custom segment. For example, this could be required if your site was migrated to Plone.
Follow the directions above for creating a custom segment, but add an 'OR' statement when defining your filter criteria. So, your conditions would be:
Include Page Begins with '[Old Site URL]'
OR
Include Page Begins with '[New Site URL]'
Viewing Custom Reports (Segments)
- Log into Google Analytics
- From any report or the Dashboard click on the down arrow next to "Advanced Segments" on the top left of the screen.
- Under "Custom Segments" you will see the segments you created. Check the segment(s) you're interested in viewing.
- Click "Apply" below the segments listing to apply that filter.
You are now viewing all of the reports that are narrowed to to only this specific segment or website. You can verify the segment is selected by looking above the graph on any report and it should say the name of the segment you created.
Note: There is a small bug in Google Analytics that causes some other hostnames/URLs to get into reports that are narrowed down to a single hostname/URL. For example, if you created an advance segment to filter all sites except ento.psu.edu you will notice a small amount of traffic from other domains will appear in the "Content" menu. We are hoping that Google fixes this problem, but the only good news is that it doesn't account for a lot of traffic that doesn't change your overall site trends.
IT Chatter Sessions on Google Analytics
Adding Google Analytics to your website
Sites within the Plone content management system have the Google Analytics code integrated, and do not require any special actions on your part.
However, if you would like your non-Plone website included in Google Analytics, please insert the following code into your website's footer or at the bottom of every page to be tracked. It should be in the HTML just above the closing </body> tag.
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4037316-1");
pageTracker._setDomainName("psu.edu");
pageTracker._initData();
pageTracker._trackPageview();
</script>
Note: If you are adding this code to a blog you need to change the setDomainName variable to your blog's domain. For example, if you are using agnews.blogspot.com then you would put in blogspot.com instead of psu.edu.
Once you add the code to your website's footer or in the template, your statistics will start to show up in the College's Google Analytics account the following day.
