IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2013-02-26T18:49:25Z by george.baker
george.baker
george.baker
314 Posts

Pinned topic Google Analytics

‏2013-02-25T18:20:50Z |
I took a quick look at the Analytics doc and it appears that adding the Google JavaScript snippet to the template used by a HATS transformation project should enable Google Analytics to work with HATS. Has anyone use Google Analytics with a HATS application? If so could you comment on how it works and how useful it is?
Updated on 2013-02-26T18:49:25Z at 2013-02-26T18:49:25Z by george.baker
  • george.baker
    george.baker
    314 Posts

    Re: Google Analytics

    ‏2013-02-25T20:38:45Z  
    This is an extension of the original post. I'm sure that Google Analytics captures the Title tag of a Web page. Currently, the Title of the page generated by HATS is set in the template with the following tag:
    
    <title><HATS:Util type=
    "applicationName" /></title>
    

    As a result all pages of the HATS application carry the same title, the name of the application, for all pages.

    I know that this tag is not documented, but is there a tag that will specify the name of the JSP instead of the application name? I've tested the following and they do not work: type="jspName", type=JSPName".
  • george.baker
    george.baker
    314 Posts

    Re: Google Analytics

    ‏2013-02-26T18:49:25Z  
    Well, I found out one way to add the screen ID to the title:
    • Extract the screen ID/name into a global variable then modify the <title> tag in the template as follows:
      
      <title><HATS:Util type=
      "applicationName" />-<%= ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable(
      "screenID", 
      
      true).getString(0) %></title>
      

    Obviously you must set the screenID global variable prior to invoking the transformation action. It is most useful when each screen is individually transformed.

    I still would like to know if anyone has any experiences with Google Analytics and HATS.