2

Is there an alternative way to add the Google Webmaster Tools HTML tag (for verification) in a Joomla website? The server doesn't let me connect to it via FTP.

I'm in the template section of the "beez3" Template. But I only see .php files. I would like to add the HTML tag (for verification) in the section.

screenshot

  • Did you implement any of the solutions provided? Your question appears to be abandoned. Please progress your question to a system-recognized resolution. – mickmackusa Feb 3 at 2:35
1

Even though you may not have access to FTP, there are at least a couple of verification methods you can use to verify site ownership.

  1. HTML File Upload

Install a Joomla file manager such as Extplorer or similar (temporarily or otherwise) and upload the supplied HTML file to the root folder of the website.

  1. Google Analytics

Register the website in Google Analytics and enable Google Analytics by entering the tracking code in your template (if it has this option) or via a third party extension. Once Google Analytics is enabled, you can use this to verify your ownership of the website in Webmaster Tools (aka Search Console).

I recommend either of the above methods in preference to editing core files as changes to core files can be undone by future updates.

1

Personally I dont like adding javascripts directly to the HTML of a template. I would rather use the addScriptDeclaration() method provided by joomla:

$doc->addScriptDeclaration("
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-79362304-1', 'auto');
  ga('send', 'pageview');

    (adsbygoogle = window.adsbygoogle || []).push({
      google_ad_client: 'ca-pub-#####################',
      enable_page_level_ads: true
  });
");

This should work in any template in any PHP file that is commonly run by the template.

0

In the case of Beez3 Template, select the file with the name index.php, add your meta tag inside the block <head>...</head> around line 80.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.