• Go to ..

    https://Your-Web-Site.com/wp-admin/plugins.php

    Find “Google Analytics” and click “Edit”

    Make sure it says …
    “Editing googleanalytics/googleanalytics.php (active)”

    Look for this code …

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '<?php echo $web_property_id ?>']);
    _gaq.push(['_trackPageview']);
    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    If you want to use the latest tracking code from Google swap it for this …

    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', '<?php echo $web_property_id ?>', 'XXX-Enter your website address here with out the https://-XXX');
      ga('send', 'pageview');
    
    </script>

    Swap “XXX-Enter your website address here with out the https://-XXX&#8221; for your website address.

    If you want to stop the the code working for the admin and just for your visitors use this code. It checks to see if you are admin. If you are, it does not run the analytic script and stops you adding counts to your website.

    Before script ..

    <?php
    if ( !is_super_admin() ) {
    ?>

    and after the analytics script…

    <?php
    }
    ?>

    This will all be lost on the next update. Lets hope he adds it into the next update.

    Let me know if this helped.

    https://www.ads-software.com/plugins/googleanalytics/

Viewing 1 replies (of 1 total)
  • I installed the plug-in and GA seems to be working OK.

    However, I need demographic data and GA says I need to update my tracking code.

    Here are the instructions they provided:

    To enable Display Advertising features for Universal Analytics, insert the bold line into your existing tracking code between the ‘create’ and ‘send’ commands, as seen in this example:

    <script>
    (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);
    ga(‘create’, ‘UA-XXXXXX-XX’, ‘example.com’);
    ga(‘require’, ‘displayfeatures’);
    ga(‘send’, ‘pageview’);
    </script>

    I can’t find where code like this is installed to add this one line. This is for the universal analytics version of GA.

Viewing 1 replies (of 1 total)
  • The topic ‘How to manually update this plugin’ is closed to new replies.