• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Google Analytics Template.

I was having issues with Google analytics with one of my websites. when I looked at the source it showed the following:

    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

    ga('create', 'UA-xxxxxxxx-x', 'auto');
    ga('send', 'pageview');
Surely the URL should be https://www.google-analytics.com/analytics.js and not //www.google-analytics.com/analytics.js ?


Well-known member
Hi @Toxic, my understanding is // makes the URL protocol-relative. I checked the newest Analytics snippet code and indeed you're correct that it is now https://

Having said that // is still working fine for me, and also the same is being used here at XF?
Last edited:


XenForo developer
Staff member
Indeed "//" is fine as it's protocol relative. I'll leave this here though as making it just pure https is probably preferable these days.