Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Sacramento State implemented the following steps, which are revisions of the original documentation to work for their environment:

Info
iconfalse

Documentation was provided by Dan Biondi at Sacramento State University

Step 1: Add the following java class file

...

Code Block
titlecomponents.xsl
<a id="contentDialogLink" onclick="_gaq.push(['_trackEvent', 'gaAcct','ADD CONTENT']);" href="javascript:;"
    	title="{$TOKEN[@name='PREFERENCES_LINK_ADD_CONTENT_LONG_LABEL']}">
    	<span><xsl:value-of select="$TOKEN[@name='PREFERENCES_LINK_ADD_CONTENT_LABEL']"/></span>
</a>

...

<a id="layoutDialogLink" onclick="_gaq.push(['_trackEvent', 'gaAcct','TAB LAYOUT']);" href="javascript:;"
   	title="{$TOKEN[@name='PREFERENCES_LINK_LAYOUT_LONG_LABEL']}">
    	<span><xsl:value-of select="$TOKEN[@name='PREFERENCES_LINK_LAYOUT_LABEL']"/></span>
</a>

...

<a id="addTabLink" onclick="_gaq.push(['_trackEvent', 'gaAcct','ADD TAB']);" href="javascript:;"
       title="{$TOKEN[@name='PREFERENCES_LINK_ADD_TAB_LONG_LABEL']}">
       <span><xsl:value-of select="$TOKEN[@name='PREFERENCES_LINK_ADD_TAB_LABEL']"/></span>
</a>

 

  • The following was then added to content.xsl (uportal-war/src/main/resources/layout/theme/universality/content.xsl)

 

Code Block
titlecontent.xsl
<xsl:if test="not(@hasHelp='false')"> <!-- Help. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Help']);" href="{$BASE_ACTION_URL}?uP_help_target={@ID}#{@ID}"
   title="{$TOKEN[@name='PORTLET_HELP_LONG_LABEL']}" class="up-portlet-control help">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_HELP_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="not(@hasAbout='false')"> <!-- About. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-About']);" href="{$BASE_ACTION_URL}?uP_about_target={@ID}#{@ID}"
   title="{$TOKEN[@name='PORTLET_ABOUT_LONG_LABEL']}" class="up-portlet-control about">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_ABOUT_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="not(@editable='false')"> <!-- Edit. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Edit']);" href="{$BASE_ACTION_URL}?uP_edit_target={@ID}#{@ID}"
   title="{$TOKEN[@name='PORTLET_EDIT_LONG_LABEL']}" class="up-portlet-control edit">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_EDIT_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="@printable='true'"> <!-- Print. -->
 <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Print']);" href="{$BASE_ACTION_URL}?uP_print_target={@ID}#{@ID}"
  title="{$TOKEN[@name='PORTLET_PRINT_LONG_LABEL']}" class="up-portlet-control print">
  <span><xsl:value-of select="$TOKEN[@name='PORTLET_PRINT_LABEL']"/></span>
 </a>
</xsl:if>

<xsl:if test="not(//focused) and @minimized='false'"> <!-- Focus. -->
  <!-- UNCOMMENT FOR MINIMIZE CONTROL -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Minimize']);"
   href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId={@ID}&amp;minimized_{@ID}_value=true&amp;uP_save=all"
   title="{$TOKEN[@name='PORTLET_MINIMIZE_LONG_LABEL']}" class="up-portlet-control minimize">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_MINIMIZE_LABEL']"/></span>
  </a>

  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Maximize']);" href="{$BASE_ACTION_URL}?uP_root={@ID}"
   title="{$TOKEN[@name='PORTLET_MAXIMIZE_LONG_LABEL']}" class="up-portlet-control focus">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_MAXIMIZE_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="@minimized='true'"> <!-- Return from Minimized. -->
 <!-- UNCOMMENT FOR UNMINIMIZE CONTROL -->
 <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-UnMinimized']);"
   href="{$BASE_ACTION_URL}uP_root=root&amp;uP_tcattr=minimized&amp;minimized_channelId{@ID}&amp;minimized_{@ID}_value=false&amp;uP_save=all"
   title="{$TOKEN[@name='PORTLET_RETURN_LONG_LABEL']}" class="up-portlet-control return">
   <span><xsl:value-of select="$TOKEN[@name='PORTLET_RETURN_LABEL']"/></span>
 </a>
</xsl:if>

<xsl:if test="not(@dlm:deleteAllowed='false') and not(//focused) and /layout/navigation/tab[@activeTab='true']/@immutable='false'"> <!-- Remove. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Removed']);" id="removePortlet_{@ID}"
    title="{$TOKEN[@name='PORTLET_REMOVE_LONG_LABEL']}" href="{$BASE_ACTION_URL}?uP_remove_target={@ID}"
    class="up-portlet-control remove"> <span><xsl:value-of select="$TOKEN[@name='PORTLET_REMOVE_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="//focused"> <!-- Return from Focused. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-UnMaximize']);" href="{$HOME_ACTION_URL}"
    title="{$TOKEN[@name='PORTLET_RETURN_LONG_LABEL']}" class="up-portlet-control return">
    <span><xsl:value-of select="$TOKEN[@name='PORTLET_RETURN_LABEL']"/></span>
  </a>
</xsl:if>

<xsl:if test="//focused[@in-user-layout='no'] and upGroup:isChannelDeepMemberOf(//focused/channel/@fname, 'local.1')"> <!-- Add to layout. -->
  <a onclick="_gaq.push(['_trackEvent','gaAcct', '{$PORTLET_TITLE}-Add']);" id="focusedContentDialogLink" href="javascript:;"
    title="{$TOKEN[@name='PORTLET_ADD_LONG_LABEL']}" class="up-portlet-control add">
    <span><xsl:value-of select="$TOKEN[@name='PORTLET_ADD_LABEL']"/></span>
  </a>
</xsl:if>

 

 

 

 

Info
iconfalse
titleAdditional References
 

...

iconfalse
titleHaving problems with these instructions?

...

  • The following was finally added to navigation.xsl (uportal-war/src/main/resources/layout/theme/universality/navigation.xsl)

 

Code Block
titlenavigation.xsl
<xsl:for-each select="tabChannel">
    <li>
       <a onclick="_gaq.push(['_trackEvent', 'gaAcct','{@name}']);" href="{$BASE_ACTION_URL}?uP_root={@ID}&amp;uP_sparam=activeTab&amp;activeTab={$TAB_POSITION}"
         title="{@name}">  <!-- Navigation item link. -->
         <span><xsl:value-of select="@name"/></span>
       </a>
     </li>
 </xsl:for-each>

 

Step 5: Rebuild uPortal

After adding all of your tracking code, you should rebuild and redeploy your portal.

Step 6: Restart Tomcat

It will take 24 hours for you tracking code to show up in the portal.


 

Info
titleInterested in Sharing your Implementation?

If you are interested in sharing your Institution's implementation of Google Analytics send a post through the mailing list at: