Auth0 Home Blog Docs

Google Analytics on hosted login page is not registering events

google-analytics

#1

Hello,
I’m trying to add Google Analytics to the hosted Lock page. I followed the guide here but no events are registered in the GA panel.

Seems simple enough, so what am I doing wrong here?

My hosted page with Lock looks like this:

<body>
  <script>
    window.auth0AnalyticsOptions = {
      'google-analytics': {
        id: 'UA-01234567-1'
      }
    }
  </script>
  <script src="https://cdn.auth0.com/js/lock/10.18/lock.min.js"></script>
  <script src="https://cdn.auth0.com/js/analytics/1.2.0/analytics.min.js"></script>
  
  <script>
    // Lock config params...
    var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
    config.extraParams = config.extraParams || {};
    var connection = config.connection;
    var prompt = config.prompt;
    .....

Help is greatly appreciated!


#2

Hi, did you ever get this sorted? I am having the exact same issue. I’m tempted to submit a question of my own, but it would be word for word the same as yours.


#3

Hi chris9,

No unfortunately not. The setup seemed simple enough so I was unsure of what to actually change.
It would be nice to hear if someone got GA working with the hosted lock page and could share their configuration.