WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. tiberakis
    Member
    Posted 1 year 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']);
      _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>

    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.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. tiberakis
    Member
    Posted 1 year ago #

    The code was in the index.php file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags