Ready to get started?Download WordPress


Google Analytics for WordPress
Extra slashes in source code (1 post)

  1. tokolosheee
    Posted 8 months ago #

    I've been trying a few plugins trying to get GA to work with my site. I finally see that this one is actually adding some code but it's coming out strange.

    The source code from my site shows the google analytics tracking code like this

    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push([\'_setAccount\', \'UA-xxxxxxxx-x\']);
      (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);

    I can see that the problem is all the extra slashes, how do I prevent those from occurring?



You must log in to post.

About this Plugin

About this Topic


No tags yet.