Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The full documentation of gathering statistics using Google Analytics for uPortal 3.2.x can be found here: Google Analytics

Sacramento State implemented the following steps of the original documentation for their environment:

Step 1: Add the following java class file

  • The attached java class, GoogleSessionThemeParameter, below needs to be added to the following location: ../uportal-impl/src/main/java/org/jasig/portal/layout/dlm/providers

This java class file will be now be located alongside the other theme processors.

Step 2: Add parameters (optional)

Sacramento State chose not to track parameters such as affiliations so this step was skipped.

Step 3: Add google analytics code

  1. Edit universality.xsl (../uportal-war/src/main/resources/layout/theme/universality/universality.xsl)
  2. Add the two following template code snippets, page.js and page-bottom.js, to universality.xsl

This section sets up asynchronous google analytics tracking. It is located in the page.js template which puts the script at the top of every generated page in the head element.

These snippets were added to universality.xsl:
universality.xsl
<xsl:template name="page.js">
	<script type="text/javascript">
		<xsl:choose>
			<xsl:when test="$serverEnv='my.uchicago.edu'">
				var env = "<xsl:value-of select="$serverEnv" />";
				var gaAcct = "*************";
			</xsl:when>

			<xsl:when test="$serverEnv='mystage.uchicago.edu'">
				var env = "<xsl:value-of select="$serverEnv" />";
				var gaAcct = "*************";
			</xsl:when>

			<xsl:otherwise>
				var env = "<xsl:value-of select="$serverEnv" />";
				var gaAcct = "*************";
			</xsl:otherwise>
		</xsl:choose>

		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', gaAcct]);

 		_gaq.push(['_setDomainName', env]);

 		_gaq.push(['_trackPageview']); 
	  </script>
</xsl:template>

 

 

 

 

Additional References

 

Having problems with these instructions?

Please send us feedback at uportal-user@lists.ja-sig.org

  • No labels