Support » Plugin: Google Analytics for WordPress by MonsterInsights » Extra slashes in source code

  • 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\') + \'\';
        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?

  • The topic ‘Extra slashes in source code’ is closed to new replies.