Integrate Google Analytics with Auth0

Integrate Google Analytics with Auth0

This article explains how to install and configure the Google Analytics for Auth0 integration. You can use this integration on your own page that is using Lock. You can configure funnels and reports inside of Google Analytics to get the most out of this integration.


  1. Set analytics configuration options before you include the references to the Lock and Auth0 Analytics libraries.

    window.auth0AnalyticsOptions = {
    'google-analytics': {
        id: 'YOUR_GA_ID',
        preloaded: true
  2. Include the script reference to the auth0-analytics.js. This needs to be included after the call to Lock.

    <script src=""></script>
    <script src=""></script>

The script version above uses a placeholder version X.Y.Z. For example, to reference release 1.3.1 use You can find the latest release's version number on GitHub.


After installation on your site, you will start collecting data. Auth0 Analytics will immediately begin sending events to Google Analytics.

You will see the following events being logged:

  • Auth0 Lock show
  • Auth0 Lock hide
  • Auth0 Lock unrecoverable_error
  • Auth0 Lock authenticated
  • Auth0 Lock authorization_error
  • Auth0 Lock forgot_password ready
  • Auth0 Lock forgot_password submit
  • Auth0 Lock signin submit
  • Auth0 Lock signup submit
  • Auth0 Lock federated login

Note that some events that Lock emits like hash_parsed are not used for analytics purposes. Also, be aware that some events are only available in newer versions of Lock. If you are using an older version of Lock you will only see some of these events. We suggest upgrading to the latest version of Lock to get the most of the Auth0 Analytics integration.

For more information on the events that are sent see the Lock API documentation.

Keep reading

Google Analytics documentation