function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Derek M HughesDerek M Hughes 

How to verify site for Google Webmaster Tools?

I have searched relentlessly and tried half a dozen approaches, but I have been singularly unsuccessful at verfiy my force.com site for Google Webmaster Tools.
These don;t work
1. Adding a URL rewriter class to try and rewrite the URL mycompany.force.com/mysite/google14c2acef515xxxx.html to a VF page.  I dont think xxxx.html can be rewritten as my re-writer works fine for an URL like this mycompany.force.com/mysite/tester
2. Added a second <HEAD></HEAD> with a meta tag in it.  It adds it to the page but Google Webmaster refused to accept it
3. Adding Google Analytics code to the page. Google Webmaster sees it but says it must be in the HEAD which is impossible
4. Tried Javascript to add a meta tag to the HEAD.  This works ok in a browser that actaully runs the javascript, but when Google Webmaster scans the page it appears not to run the javascript.

Has anyone succesfully verfied a force.com site with Google Webmaster Tools?  If so, please explain how you managed it.

Thanks in advance.

Derek
 
Best Answer chosen by Derek M Hughes
Himanshu ParasharHimanshu Parashar
Hi Derek,

You need to define head tag manually as shown below using the applyHTMLTag and applyBodyTag
 
<apex:page applyHtmlTag="false" applyBodyTag="false" showHeader="false">
<html>
<head>
<meta name="google-site-verification" content="Codehere" />
</head>
<body>
<!-- Page code -->
</body>
</html>

</apex:page>

Thanks,
Himanshu

All Answers

Himanshu ParasharHimanshu Parashar
Hi Derek,

You need to define head tag manually as shown below using the applyHTMLTag and applyBodyTag
 
<apex:page applyHtmlTag="false" applyBodyTag="false" showHeader="false">
<html>
<head>
<meta name="google-site-verification" content="Codehere" />
</head>
<body>
<!-- Page code -->
</body>
</html>

</apex:page>

Thanks,
Himanshu
This was selected as the best answer
Derek M HughesDerek M Hughes

HI,

That works perfectly.  Thanks for the assistance.

Regards

Derek