This documentation is for WSO2 API Manager 1.7.0 View documentation for the latest release.
Page Comparison - Integrating with Google Analytics (v.1 vs v.2) - API Manager 1.7.0 - WSO2 Documentation

All docs This doc

Versions Compared


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


  1. Setup 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 $APIM_HOME/repository/conf/api-manager.xml. Enable the <GoogleAnalyticsTracking> element and enter the Tracking-ID.

    Code Block
       <!-- Enable/Disable Google Analytics Tracking -->
       <!-- Google Analytics Tracking ID -->
  3. Save the file and restart the API Manager instance.
  4. API Manager is now integrated with Google Analytics. A user who has subscribed to a published API through the API Store should see an icon as Real-Time after logging into their Google Analytics account. Click on this icon and select Overview.
  5. Invoke the above API using the embedded WSO2 REST Client (or any third-part rest client such as cURL).

    Real-time statistics

  6. This is one invocation of the API. Accordingly, Google Analytics graphs and statistics will be displayed at runtime. This example displays the PageViews per second graph and 1 user as active.

    Reporting statistics

    Google analytics reporting statistics take more than 24 hours from the time of invocation to populate. Shown below is a sample Dashboard with populated statistics.

    There are widgets with statistics related to Audience, Traffic, Page Content, Visit Duration etc. You can add any widget of your preference to dashboard.