Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Set Window Title

Set Window Title

If you're interested in branding your  catalog a little better, then you'll want to change your Title Bar to  show your company name instead of newScale Service Catalog.

<script language="javascript" type="text/javascript">
document.title = "HNTB Service Catalog";
</script>

This  is fine for normal use, but we ran into a dilemma when we started  testing out Google Analytics.  The URL's don't easily tell you the  actual page that they're showing data for.

For example, one of the  pages looks like this:  /RequestCenter/myservices/myservice.do?resetBN=true .  Analytics doesn't  know how to change this into a useful title for us, and we'd have to do  some database calls in order to match things up with the actual  category names and service names for those particular URL's.

To  deal with this, I made up this small script that takes the last piece of  the breadcrumb and appends it to your Title Bar.  In Google Analytics, I  can view a report of "Content By Title", which shows me a page like  this "HNTB Service Catalog - Home", making it much easier to use the  data that is gathered.  Try it out and see what you think.  This script  goes in your footer, because it has to be called after the breadcrumb is  generated, so the header won't work for it.

<script type="text/javascript">
function JS_GetBreadcrumb()
{
bcdiv = document.getElementById("bread_nav");
bctext = bcdiv.innerHTML;
pos1 = bctext.indexOf("<B>") + 3;
pos2 = bctext.indexOf("</B>");
//alert(bctext.substring(pos1,pos2));
document.title = document.title + " - " + bctext.substring(pos1,pos2);
}
JS_GetBreadcrumb();
</script>

I hope this can help somebody, and would love to hear how you would use something like this.

  • Intelligent Automation
Everyone's tags (1)
141
Views
0
Helpful
0
Replies
This widget could not be displayed.