Adding google analytics to new universal login experience

Hi guys,

Is it possible to add google analytics to the NEW universal login experience?
As I understood, with the classic universal login it is possible to customize the login page using the HTML template and insert the google analytics script in the template.

But how do I do that for the new universal login?
Many thanks!

New Universal Login Experience is rendered on server and does not support customization like Classic Login Experience.

The key structural difference from the Classic Experience is that the former uses Javascript widgets in all the pages, while the New Experience is rendered on the server and does not require Javascript.

As we can not customize it, I do NOT think it will be possible to add google analytics like Classic Login Experience. It has some limitation as It is not yet at feature parity with the Classic Experience


Yep that’s true. Basically New Universal Login Experience was designed to be much more light-weight in comparison to the Classic one but at the cost of being less customisable and feature packed

1 Like

Hey there, if I can customize the page, can I add script tag?


Not sure about it but I’m pretty sure we didn’t design it the way to work like that

When I try to set to the template below I get following error:

{"statusCode":400,"error":"Bad Request","message":"The template must contain a single auth0:head tag and at least one auth0:widget tag.","errorCode":"invalid_body"}

There is an issue with my request? Or you designed not to work this way?
If I remove the script tag it works.

<!DOCTYPE html>
      {%- auth0:head -%}

         new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

      <title>Custom Title</title>
       {%- auth0:widget -%}
       <noscript><iframe src=""
        height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

That’s it because we do not support that unfortunately

I just checked with bootstrap script tag and it works.
The issue is because the google tag manager script is adding elements to the DOM?

I don’t know to be honest. For sure there’s some hacky workaround that you will need to figure out yourself as unfortunately we do not support it officially.

I managed to add GTM (Google Tag Manager) to the template.
Simply add the script tag, but make sure to use double quotes " and not single ' everywhere in the code.

1 Like

Perfect! Thanks for sharing with the rest of community!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.