Skip to main content

Web Analytics Solutions

You're reading Identity & Access Management 7.0.0. The newest release is 7.3.0, and Cloud has the newest features. Go to the newest release

Web Analytics are used to analyze web traffic and user interactions on a website. WSO2 Identity Server supports integrating Google Analytics and Mixpanel as analytics solutions and allows you to enable either one or both of them.

Set up web analytics​

Follow the steps below to configure a web analytics solution for WSO2 Identity Server.

  1. Create an analytics project and obtain the relevant token.

    • For Google analytics:

      1. Follow the Google analytics documentation and create an analytics project.

      2. Navigate to Admin > Tracking Info > Tracking Code, and look for the token of your project in gtag('config', '<TOKEN>');.

    • For Mixpanel:

      1. Follow the Mixpanel documentation and create an analytics project.

      2. Navigate to Settings > Set up Mixpanel, and look for the token of your project in mixpanel.init("<TOKEN>");.

  2. Download the samples-is repository and extract its content.

  3. In the samples-is root directory, go to analytics-extensions and open the config.jsp file. Add the token/s obtained in step 1 above to the relevant line of the file.

    // Insert your Google Analytics token here.
    private static final String GOOGLE_ANALYTICS_TOKEN = "<GOOGLE_ANALYTICS_TOKEN>";

    // Insert your Mixpanel token here.
    private static final String MIXPANEL_TOKEN = "<MIXPANEL_TOKEN>";
  4. Copy the analytics.jsp and config.jsp files found in analytics-extensions and paste them in both <IS_HOME>/authenticationendpoint/include and <IS_HOME>/accountrecoveryendpoint/include directories.

  5. Find the header.jsp file located in both <IS_HOME>/authenticationendpoint/include and <IS_HOME>/accountrecoveryendpoint/include directories and add the following line to the end of the files.

    <%-- Include analytics --%>
    <jsp:directive.include file="/includes/analytics.jsp"/>
  6. Run WSO2 Identity Server instance and the analytics events will be fired when users access the relevant web pages.

Types of analytic events​

The following are the events that are captured when analytics are enabled in WSO2 Identity Server.

Event nameDescription
wso2_generic_eventA generic event that will be fired unless the event belongs to one of the types below.
wso2_errorAn error has occurred.
wso2_loginThe login page has been visited.
wso2_login_failureLogin has failed.
wso2_sign_up_usernameSelf sign up username page has been visited.
wso2_sign_up_detailsSelf sign up user detail collection page has been visited.
wso2_sign_up_request_completeA request for a self sign up has been completed.
wso2_sign_up_process_completeA sign up flow has been completed including the confirmation.
wso2_username_recoveryUsername recovery page has been visited.
wso2_password_recoveryPassword recovery page has been visited.
wso2_recovery_request_completeRequest for a username/password recovery is complete.
wso2_password_recovery_resetPassword reset page has been visited.
wso2_password_recovery_completeA password recovery flow has been successfully completed.
wso2_privacy_policyPrivacy policy page has been visited.
wso2_cookie_policyCookie policy page has been visited.

View analytics​

You can view the analytics events from the dashboards of Google Analytics and Mixpanel. The following are sample views.

Google Analytics​

google-analytics

Mixpanel​

mixpanel-analytics

Was this page helpful?