Meta tags are your friend part 1: Tracking roles in Sungard Luminis with Google Analytics
by David. Average Reading Time: about 3 minutes.
At work, we use Sungard HE‘s Luminis portal (v3.3) — It’s been good to us over the years, but there’s a lack of usage information regarding users’ roles and their interactions with Luminis.
In the past, we’ve added Google Analytics to Luminis to track the interactions, but never managed to fully segment user roles. Until now.
Out of the box, Luminis has roles such as staff, student, faculty, ProspectiveStudent etc. Users can have one or more of these roles and other custom roles too. If we could capture all the roles and pass them onto Google Analytics, then we’d be able to fully segment the user types and gain a better understanding of how each segment uses Luminis.
This post aims to show how this is possible in just 3 steps:
- XSL: Edit nested-tables.xsl to add a custom meta tag for the luminis roles
- Javascript/jQuery: Read the custom meta tag and set a custom variable in Google Analytics
- Google Analytics: Create custom segments to view traffic for specific Luminis roles
Edit nested-tables.xsl and add a custom meta tag to the header
We’ve seriously hacked at nested-tables.xsl over the years, so our version of the file is likely to be different to most. The main aim here is to find the html > head section and add a custom meta tag:
<!-- Dump all roles into a single meta tag as a comma separated value --> <meta name="luminis.role"> <xsl:attribute name="content"> <xsl:for-each select="//layout/cp:cpInfo/cp:cpProperty[@name='pdsRole']/child::*"> <xsl:value-of select="concat(., ',')" /> </xsl:for-each> </xsl:attribute> </meta>
Read the custom meta tag and set a custom variable in Google Analytics
Our implementation of Google Analytics is a little complex, but this example I’ve based on the standard Google Analytics example code.
Using Javascript (infused with jQuery in our case), we can read the custom meta tag and set a custom variable.
<script type="text/javascript">
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">
window.onload = function(){
try
{
var pageTracker = _gat._getTracker("UA-XXXXX-XX");
if (typeof $('meta[name=luminis.role]').attr("content") == 'string')
{
pageTracker._setCustomVar(
1, // This custom var is set to slot #1 of the 5 available in GA
"luminis.role", // The name acts as a kind of category for the user activity
','+$('meta[name=luminis.role]').attr("content"), // The value of the custom variable (starting with a comma)
2 // Sets the scope to session-level
);
}
pageTracker._trackPageview();
}
catch (err) {}
}
</script>
According to the documentation, it’s important to set the custom variable before tracking the page view.
Create custom segments to view traffic for specific Luminis roles
Sign in to Google Analytics and view your normal website reports.
Click on Advanced segments | Create a new advanced segment
Create a new segment where…
Custom variable (Value 1) contains ,staff,
AND
Custom variable (Value 1) contains ,faculty,
Note the surrounding commas – we’re using them as role delimiters.
Give the segment a name e.g. “Luminis roles: staff AND faculty”"
All done, but have patience
Your custom segment is now available from the advanced segment drop-down:
![]()
Custom variables seem to take longer to filter through to Google Analytics than normal data such as page views. So come back in a couple of days and try out your new advanced segment.
Update (12 April 2010):
Shortly after I published this post, the Google Analytics blog posted their webinar on Google Analytics custom variables.
Also, if you’re interested in creating advanced segments from custom variables, I’ve posted ayoutube video that steps through the process.


Meta tags are your friend part 1: Tracking roles in Sungard …: At work, we use Sungard HE's Luminis portal (v3.3… http://bit.ly/cje3xG
Meta tags are your friend part 1: Tracking roles in Sungard …: At work, we use Sungard HE's Luminis portal (v3.3… http://bit.ly/cje3xG
[...] This post was mentioned on Twitter by David Simpson, Leon Lewis Jr. Leon Lewis Jr said: Meta tags are your friend part 1: Tracking roles in Sungard …: At work, we use Sungard HE's Luminis portal (v3.3… http://bit.ly/cje3xG [...]
Hey man, great idea to integrate that into the GA stats.
Couple questions though, are you on Luminis 3 or 4 ?
Did you have to add anything else to the header of nested-tables.xsl to get the to actually work ?
I can’t get it to return anything.
Could you possibly post the < xsl:stylesheet block from the top of nested-tables.xsl for me – or email it to me ?
-Jon
Jon: We’re on v3.3.1 (I know). This is probably the problem, because the XSL was changed in v3.3.3 – for example, you had to start writing Java if you wanted to customise the app icons. I’ll email the XSL anyway.