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

XF 1.1 Can't Verify my site on Webmaster Tools?

#1
I can't verify my site with the original Google_Analytics xenforo template code ->

Code:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>

    var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_trackPageview']];
    !function(d, t)
    {
        var g = d.createElement(t),
            s = d.getElementsByTagName(t)[0];
        g.async = true;
        g.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        s.parentNode.insertBefore(g, s);
    }
    (document, 'script');

    </script><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>
I changed it and now Google Webmaster verify without problems (any tips?)

This code is ok? (I got it on analytics website) Thanks

Code:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}">

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

</xen:if>
 

Brogan

XenForo moderator
Staff member
#3
You will likely need to contact Google to ascertain why it is being rejected as the default template seems to work for everyone else.