3
Vote

Site Verification

description

Google can use the Analytics script to verify your site (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185871). However the script must be in the <head> in order to be used for verification. The Orchard.GoogleAnalytics Module puts the analytics script at the bottom but this can't be used by Google for site verification.

Only a small point and doesn't affect the working of Analytics, but moving the <script> inside the <head> would increase the utility of this Module.

Dave.

comments

jao28 wrote Jul 26, 2012 at 6:45 PM

I looked into this and just needed to change two lines on the "Filters/TrackerFilter.cs" file. I commented out lines 52 and 53 and then added two new lines (all as seen here):
        //var tail = context.Layout.Tail;
        //tail.Add(new MvcHtmlString(script));

        var head = context.Layout.Head;
        head.Add(new MvcHtmlString(script));
I cannot confirm this works for every site but it does for mine - hope it helps and it can be added into the source code.

samuelmac wrote Oct 20, 2012 at 3:49 AM

@jao28's solution worked beautifully. Cheers mate.