Documentation courtesy of Bill Brown, Web Application Developer, from The University of Chicago
Google Analytics page and event tracking can be setup in uPortal. The examples use the analytics tracking API (http://code.google.com/apis/analytics/docs/tracking/home.html),
a java filter and a uPortal IParameterProcessor to achieve session based tracking of portal events for users of a uPortal instance.
The examples can be adapted for your institutions requirements by swapping in different user attributes.
-----
Step 1: Create a Google Analytics Account
Create a Google Analytics account at www.google.com/analytics
Configure any custom dimensions that you wish to track.
Step 2: Configure Google Analytics in uPortal
There are two ways to configure the Google Analytics feature in uPortal
Option 1: Configure through the UI
- Login as an administrator
- Go to the Portal Administration portlet (Under the Admin Tools tab) and click on the Manage Portlets link
- Search for "Google Analytics configuration" and click Edit
- Click on the "Edit Rich Configuration" link
- Fill out the form with your Google Analytics details and click "Save"
Option 2: Configure through the portlet definition file
- Open the portlet definition file at uPortal-4.0.12/uportal-war/src/main/data/quickstart_entities/portlet-definition/google-analytics-config.portlet-definition.xml
- Uncomment the "defaultConfig" section and modify with your Google Analytics information (see example configuration below)
- Import the updated file one of two ways:
- Use the data-import command (ant data-import -Dfile=uPortal-4.0.12/uportal-war/src/main/data/quickstart_entities/portlet-definition/google-analytics-config.portlet-definition.xml)
- Or, upload the modified file through the interface
- Go to the Portal Administration portlet (Under the Admin Tools tab) and click on the Import, Export, and Delete Entities link
- Click the "Choose File" Button and upload the modified google-analytics-config.portlet-definition.xml
uPortal-4.0.12/uportal-war/src/main/data/quickstart_entities/portlet-definition/google-analytics-config.portlet-definition.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <portlet-definition version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/portlet-definition https://source.jasig.org/schemas/uportal/io/portlet-definition/portlet-definition-4.0.xsd" xmlns:ns2="https://source.jasig.org/schemas/uportal" xmlns="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/event-aggregation" xmlns:ns5="https://source.jasig.org/schemas/uportal/io/permission-owner" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/subscribed-fragment" xmlns:ns7="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns8="https://source.jasig.org/schemas/uportal/io/user"> <title>Google Analytics Configuration</title> <name>Google Analytics Configuration</name> <fname>google-analytics-config</fname> <desc></desc> <type>Portlet</type> <timeout>1000</timeout> <portlet-descriptor> <ns2:isFramework>true</ns2:isFramework> <ns2:portletName>GoogleAnalytics</ns2:portletName> </portlet-descriptor> <group>Everyone</group> <parameter> <name>alternate</name> <value>false</value> </parameter> <parameter> <name>blockImpersonation</name> <value>false</value> </parameter> <parameter> <name>disableDynamicTitle</name> <value>true</value> </parameter> <parameter> <name>editable</name> <value>false</value> </parameter> <parameter> <name>hasAbout</name> <value>false</value> </parameter> <parameter> <name>hasHelp</name> <value>false</value> </parameter> <parameter> <name>hideFromMobile</name> <value>false</value> </parameter> <parameter> <name>highlight</name> <value>false</value> </parameter> <parameter> <name>showChrome</name> <value>false</value> </parameter> <portlet-preference> <name>config</name> <readOnly>false</readOnly> <value> { "defaultConfig":{ "name":"", "propertyId":"UA-removednumbers-6", "config":[ ], "dimensionGroups":[ {"name":"1","value":"Administrators"}, {"name":"2","value":"Applicant - Graduate"}, {"name":"3","value":"Applicant - Professional"}, {"name":"4","value":"Applicant - Special"}, {"name":"5","value":"Applicant - Undergraduate"}, {"name":"6","value":"Facstaff"}, {"name":"7","value":"Facstaff - Former Appointment"}, {"name":"8","value":"Former Student"}, {"name":"9","value":"Not Portal Activated"}, {"name":"10","value":"Portal Ineligible"}, {"name":"11","value":"Student"}, {"name":"12","value":"System Portal Ineligible"}, {"name":"13","value":"Users - Advisors"}, {"name":"14","value":"Users - Instructors"} ] }, "hosts":[ { "name":"my-qa.wisconsin.edu", "propertyId":"UA-removednumbers-7", "config":[ ], "dimensionGroups":[ {"name":"1","value":"UW System-Colleges"}, {"name":"2","value":"UW System-Eau Claire"}, {"name":"3","value":"UW System-Extension"}, {"name":"4","value":"UW System-Green Bay"}, {"name":"5","value":"UW System-La Crosse"}, {"name":"6","value":"UW System-Madison"}, {"name":"7","value":"UW System-Milwaukee"}, {"name":"8","value":"UW System-Oshkosh"}, {"name":"9","value":"UW System-Parkside"}, {"name":"10","value":"UW System-Platteville"}, {"name":"11","value":"UW System-River Falls"}, {"name":"12","value":"UW System-Stevens Point"}, {"name":"13","value":"UW System-Stout"}, {"name":"14","value":"UW System-Superior"}, {"name":"15","value":"UW System-System Administration"}, {"name":"16","value":"UW System-Whitewater"} ] } ] } </value> </portlet-preference> </portlet-definition>