Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can configure the APP Manager to track web application invocation statistics through Google Analytics (http://www.google.com/analytics). Google Analytics is a service that allows you to track visits to a website and generate detailed statistics on them.

This guide explains how to setup APP Manager in order set up App Manager to feed runtime statistics to Google analytics for summarization and display.

  1. Setup If you are not already subscribed, set up a Google Analytics account if not subscribed already and receive a Tracking ID, which is of the format "UA-XXXXXXXX-X". A Tracking ID is issued at the time an account is created with Google Analytics.

  2. Open $APPM_HOME/repository/conf/api-manager.xml. Enable the <GoogleAnalyticsTracking> element and enter the Tracking-ID.

     

    Code Block
    <GoogleAnalyticsTracking>
       <!-- Enable/Disable Google Analytics Tracking -->
       <Enabled>false</Enabled>
       <!-- Google Analytics Tracking ID -->
       <TrackingID>UA-XXXXXXXX-X</TrackingID>
    </GoogleAnalyticsTracking>
  3. Save the file and restart the APP Manager instance.

  4. Once we have the APP Manager setup to integrate with your Google Analaytics account, we have to place the following JavaScript snippet onto the pages we wish to track.

    Code Block
    <script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
    <script language=”javascript”>
        function invokeStatistics(){         
        var tracking_code = ["<AM_TRACKING_CODE>"];         
        var request = $.ajax({        
            url: "http://<AM_GATEWAY_URL>:8280/statistics/",        
            type: "GET",        
            headers: {            
                "trackingCode":tracking_code,        
                }              
            }
        );    
    }
    </script>

...