WordPress.org

Ready to get started?Download WordPress

Forums

Google AdSense and Google Analytics Remover
Analytics not removed (1 post)

  1. Stufo76
    Member
    Posted 1 year ago #

    Hi all,

    my adsense is substituted by placeholder, but analytics don't.

    I suspect regexp used is not updated:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    $buffer = preg_replace("/<script(?:(?!<\/script>|_gaq)[\s\S])+_gaq(?:(?!<\/script>)[\s\S])+<\/script>/i", "", $buffer);				// Remove Google Analytics code

    Here is my analytics tracking code:

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

    Can you help me?

    http://wordpress.org/extend/plugins/google-adsense-and-google-analytics-remover/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.