Yoast SEO
[resolved] google java script in sitemap (2 posts)

  1. tiberakis
    Posted 3 years ago #

    I got this java script, that I inserted in my pages in order to have them indexed by google, at the beginning of my sitemap_index.hml:

    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UZ-123456789-1']);
      (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);

    This results in having an error message:

    error on line 14 at column 6: XML declaration allowed only at the start of the document

    What is worst, Google analytic doesn't recognize the file.
    I eliminated the script from each page and article, but it is still present in the sitemape_index and I am not able to change that.
    How can I regenerate the sitemap? Help please.
    My site is velespiegate.it.


  2. tiberakis
    Posted 3 years ago #

    The code was in the index.php file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic